home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1994-11-04 | 11.9 KB | [TEXT/MMCC] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Fri Nov 4 03:42:17 1994, modified Fri Nov 4 03:42:17 1994, creator 'MMCC', type ASCII, 11470 bytes "MeasureMTF.c" , at 0x2d4e 470 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MMCC] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 4d 65 61 73 75 72 | 65 4d 54 46 2e 63 00 00 |..Measur|eMTF.c..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 00 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 2c ce 00 | 00 01 d6 aa df a4 69 aa |.....,..|......i.|
|00000060| df a4 69 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..i.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 ca 64 00 00 |........|.....d..|
|00000080| 2f 2a 0d 4d 65 61 73 75 | 72 65 4d 54 46 2e 63 0d |/*.Measu|reMTF.c.|
|00000090| 43 6f 70 79 72 69 67 68 | 74 20 a9 20 31 39 39 30 |Copyrigh|t . 1990|
|000000a0| 2d 31 39 39 33 20 44 65 | 6e 69 73 20 47 2e 20 50 |-1993 De|nis G. P|
|000000b0| 65 6c 6c 69 0d 4d 65 61 | 73 75 72 65 73 20 74 68 |elli.Mea|sures th|
|000000c0| 65 20 6d 6f 64 75 6c 61 | 74 69 6f 6e 20 74 72 61 |e modula|tion tra|
|000000d0| 6e 73 66 65 72 20 66 75 | 6e 63 74 69 6f 6e 20 6f |nsfer fu|nction o|
|000000e0| 66 20 61 20 6d 6f 6e 69 | 74 6f 72 2e 20 55 73 65 |f a moni|tor. Use|
|000000f0| 73 20 64 72 69 66 74 69 | 6e 67 20 67 72 61 74 69 |s drifti|ng grati|
|00000100| 6e 67 73 2c 0d 62 6f 74 | 68 20 68 6f 72 69 7a 6f |ngs,.bot|h horizo|
|00000110| 6e 74 61 6c 20 61 6e 64 | 20 76 65 72 74 69 63 61 |ntal and| vertica|
|00000120| 6c 2c 20 6f 66 20 63 6f | 6e 73 74 61 6e 74 20 74 |l, of co|nstant t|
|00000130| 65 6d 70 6f 72 61 6c 20 | 66 72 65 71 75 65 6e 63 |emporal |frequenc|
|00000140| 79 2e 20 54 68 65 20 72 | 65 73 75 6c 74 73 0d 61 |y. The r|esults.a|
|00000150| 72 65 20 73 61 76 65 64 | 20 69 6e 20 61 20 4b 61 |re saved| in a Ka|
|00000160| 6c 65 69 64 61 47 72 61 | 70 68 20 74 65 78 74 20 |leidaGra|ph text |
|00000170| 66 69 6c 65 2c 20 4d 54 | 46 3f 2e 64 61 74 61 2c |file, MT|F?.data,|
|00000180| 20 77 68 65 72 65 20 3f | 20 73 74 61 6e 64 73 20 | where ?| stands |
|00000190| 66 6f 72 20 74 68 65 20 | 73 63 72 65 65 6e 0d 6e |for the |screen.n|
|000001a0| 75 6d 62 65 72 2e 20 54 | 68 65 20 64 61 74 61 20 |umber. T|he data |
|000001b0| 66 69 6c 65 20 69 6e 63 | 6c 75 64 65 73 20 74 68 |file inc|ludes th|
|000001c0| 65 20 64 63 20 61 6e 64 | 20 73 65 63 6f 6e 64 20 |e dc and| second |
|000001d0| 68 61 72 6d 6f 6e 69 63 | 2e 0d 48 49 53 54 4f 52 |harmonic|..HISTOR|
|000001e0| 59 3a 0d 31 30 2f 31 31 | 2f 39 30 09 64 67 70 09 |Y:.10/11|/90.dgp.|
|000001f0| 77 72 6f 74 65 20 69 74 | 2e 0d 31 30 2f 31 32 2f |wrote it|..10/12/|
|00000200| 39 30 09 64 67 70 09 61 | 64 64 65 64 20 64 63 20 |90.dgp.a|dded dc |
|00000210| 61 6e 64 20 68 61 72 6d | 6f 6e 69 63 73 2e 0d 33 |and harm|onics..3|
|00000220| 2f 31 38 2f 39 31 09 09 | 64 67 70 09 75 70 64 61 |/18/91..|dgp.upda|
|00000230| 74 65 64 20 74 6f 20 77 | 6f 72 6b 20 77 69 74 68 |ted to w|ork with|
|00000240| 20 6e 65 77 20 50 6c 6f | 74 58 59 2c 20 62 75 74 | new Plo|tXY, but|
|00000250| 20 6e 6f 74 20 74 65 73 | 74 65 64 0d 34 2f 31 35 | not tes|ted.4/15|
|00000260| 2f 39 31 09 09 64 67 70 | 20 43 68 65 63 6b 20 66 |/91..dgp| Check f|
|00000270| 6f 72 20 4e 65 77 50 61 | 6c 65 74 74 65 4d 61 6e |or NewPa|letteMan|
|00000280| 61 67 65 72 28 29 2e 0d | 38 2f 32 34 2f 39 31 09 |ager()..|8/24/91.|
|00000290| 09 64 67 70 09 4d 61 64 | 65 20 63 6f 6d 70 61 74 |.dgp.Mad|e compat|
|000002a0| 69 62 6c 65 20 77 69 74 | 68 20 54 48 49 4e 4b 20 |ible wit|h THINK |
|000002b0| 43 20 35 2e 30 2e 0d 33 | 2f 31 30 2f 39 32 09 64 |C 5.0..3|/10/92.d|
|000002c0| 67 70 09 69 6e 63 6c 75 | 64 65 20 6d 63 36 38 38 |gp.inclu|de mc688|
|000002d0| 38 31 2e 68 0d 38 2f 32 | 37 2f 39 32 09 64 67 70 |81.h.8/2|7/92.dgp|
|000002e0| 09 72 65 70 6c 61 63 65 | 20 53 79 73 45 6e 76 69 |.replace| SysEnvi|
|000002f0| 72 6f 6e 73 28 29 20 62 | 79 20 47 65 73 74 61 6c |rons() b|y Gestal|
|00000300| 74 28 29 0d 31 30 2f 32 | 33 2f 39 32 20 64 67 70 |t().10/2|3/92 dgp|
|00000310| 20 74 72 79 20 74 6f 20 | 72 65 61 64 20 6c 61 74 | try to |read lat|
|00000320| 65 73 74 20 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |est Lumi|nanceRec|
|00000330| 6f 72 64 0d 32 2f 37 2f | 39 33 09 64 67 70 09 75 |ord.2/7/|93.dgp.u|
|00000340| 70 64 61 74 65 64 20 74 | 6f 20 75 73 65 20 53 65 |pdated t|o use Se|
|00000350| 74 50 69 78 65 6c 73 51 | 75 69 63 6b 6c 79 2e 0d |tPixelsQ|uickly..|
|00000360| 2a 2f 0d 23 69 6e 63 6c | 75 64 65 20 22 56 69 64 |*/.#incl|ude "Vid|
|00000370| 65 6f 54 6f 6f 6c 62 6f | 78 2e 68 22 0d 23 69 6e |eoToolbo|x.h".#in|
|00000380| 63 6c 75 64 65 20 3c 6d | 61 74 68 2e 68 3e 0d 23 |clude <m|ath.h>.#|
|00000390| 69 6e 63 6c 75 64 65 20 | 3c 61 73 73 65 72 74 2e |include |<assert.|
|000003a0| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 22 4c 75 6d |h>.#incl|ude "Lum|
|000003b0| 69 6e 61 6e 63 65 2e 68 | 22 0d 23 69 6e 63 6c 75 |inance.h|".#inclu|
|000003c0| 64 65 20 3c 50 61 63 6b | 61 67 65 73 2e 68 3e 0d |de <Pack|ages.h>.|
|000003d0| 23 69 66 20 28 54 48 49 | 4e 4b 5f 43 20 7c 7c 20 |#if (THI|NK_C || |
|000003e0| 54 48 49 4e 4b 5f 43 50 | 4c 55 53 29 0d 09 23 69 |THINK_CP|LUS)..#i|
|000003f0| 6e 63 6c 75 64 65 20 3c | 70 72 6f 66 69 6c 65 2e |nclude <|profile.|
|00000400| 68 3e 09 2f 2a 20 66 6f | 72 20 74 69 6d 69 6e 67 |h>./* fo|r timing|
|00000410| 20 2a 2f 0d 09 23 69 6e | 63 6c 75 64 65 20 3c 63 | */..#in|clude <c|
|00000420| 6f 6e 73 6f 6c 65 2e 68 | 3e 0d 09 23 64 65 66 69 |onsole.h|>..#defi|
|00000430| 6e 65 20 50 52 4f 46 49 | 4c 45 20 31 0d 23 65 6e |ne PROFI|LE 1.#en|
|00000440| 64 69 66 0d 23 64 65 66 | 69 6e 65 20 54 57 4f 5f |dif.#def|ine TWO_|
|00000450| 50 49 20 28 32 2e 30 2a | 50 49 29 0d 23 64 65 66 |PI (2.0*|PI).#def|
|00000460| 69 6e 65 20 4d 41 58 28 | 61 2c 62 29 20 28 28 61 |ine MAX(|a,b) ((a|
|00000470| 29 3e 28 62 29 3f 28 61 | 29 3a 28 62 29 29 0d 23 |)>(b)?(a|):(b)).#|
|00000480| 64 65 66 69 6e 65 20 4d | 49 4e 28 61 2c 62 29 20 |define M|IN(a,b) |
|00000490| 28 28 61 29 3c 28 62 29 | 3f 28 61 29 3a 28 62 29 |((a)<(b)|?(a):(b)|
|000004a0| 29 0d 0d 76 6f 69 64 20 | 4d 65 61 73 75 72 65 4d |)..void |MeasureM|
|000004b0| 54 46 28 76 6f 69 64 29 | 3b 0d 64 6f 75 62 6c 65 |TF(void)|;.double|
|000004c0| 20 4d 65 61 73 75 72 65 | 43 6f 6e 74 72 61 73 74 | Measure|Contrast|
|000004d0| 28 47 44 48 61 6e 64 6c | 65 20 64 65 76 69 63 65 |(GDHandl|e device|
|000004e0| 2c 4c 75 6d 69 6e 61 6e | 63 65 52 65 63 6f 72 64 |,Luminan|ceRecord|
|000004f0| 20 2a 4c 50 2c 69 6e 74 | 20 74 50 65 72 69 6f 64 | *LP,int| tPeriod|
|00000500| 2c 64 6f 75 62 6c 65 20 | 63 5b 31 30 5d 2c 57 69 |,double |c[10],Wi|
|00000510| 6e 64 6f 77 50 74 72 20 | 70 6c 6f 74 57 69 6e 64 |ndowPtr |plotWind|
|00000520| 6f 77 29 3b 0d 64 6f 75 | 62 6c 65 20 73 61 77 28 |ow);.dou|ble saw(|
|00000530| 64 6f 75 62 6c 65 20 78 | 29 3b 0d 0d 76 6f 69 64 |double x|);..void|
|00000540| 20 6d 61 69 6e 28 76 6f | 69 64 29 0d 7b 0d 09 61 | main(vo|id).{..a|
|00000550| 73 73 65 72 74 28 53 74 | 61 63 6b 53 70 61 63 65 |ssert(St|ackSpace|
|00000560| 28 29 3e 31 30 30 30 29 | 3b 0d 09 53 74 61 63 6b |()>1000)|;..Stack|
|00000570| 47 72 6f 77 28 33 30 30 | 30 30 29 3b 0d 09 52 65 |Grow(300|00);..Re|
|00000580| 71 75 69 72 65 28 67 65 | 73 74 61 6c 74 38 42 69 |quire(ge|stalt8Bi|
|00000590| 74 51 44 29 3b 0d 09 4d | 65 61 73 75 72 65 4d 54 |tQD);..M|easureMT|
|000005a0| 46 28 29 3b 0d 7d 0d 0d | 76 6f 69 64 20 4d 65 61 |F();.}..|void Mea|
|000005b0| 73 75 72 65 4d 54 46 28 | 76 6f 69 64 29 0d 7b 0d |sureMTF(|void).{.|
|000005c0| 09 47 44 48 61 6e 64 6c | 65 20 64 65 76 69 63 65 |.GDHandl|e device|
|000005d0| 2c 6f 6c 64 47 44 48 61 | 6e 64 6c 65 3b 0d 09 43 |,oldGDHa|ndle;..C|
|000005e0| 57 69 6e 64 6f 77 50 74 | 72 20 77 69 6e 64 6f 77 |WindowPt|r window|
|000005f0| 3b 0d 09 57 69 6e 64 6f | 77 50 74 72 20 70 6c 6f |;..Windo|wPtr plo|
|00000600| 74 57 69 6e 64 6f 77 2c | 6d 74 66 57 69 6e 64 6f |tWindow,|mtfWindo|
|00000610| 77 3b 0d 09 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |w;..Lumi|nanceRec|
|00000620| 6f 72 64 20 4c 52 3b 0d | 09 63 68 61 72 20 73 74 |ord LR;.|.char st|
|00000630| 72 69 6e 67 5b 31 30 30 | 5d 2c 73 74 72 69 6e 67 |ring[100|],string|
|00000640| 32 5b 31 30 30 5d 2c 6f | 75 74 4e 61 6d 65 5b 31 |2[100],o|utName[1|
|00000650| 30 30 5d 3b 0d 09 75 6e | 73 69 67 6e 65 64 20 6c |00];..un|signed l|
|00000660| 6f 6e 67 20 73 65 63 6f | 6e 64 73 3b 0d 09 46 49 |ong seco|nds;..FI|
|00000670| 4c 45 20 2a 6f 75 74 66 | 69 6c 65 5b 32 5d 3b 0d |LE *outf|ile[2];.|
|00000680| 09 69 6e 74 20 69 2c 74 | 50 65 72 69 6f 64 2c 77 |.int i,t|Period,w|
|00000690| 69 64 74 68 3b 0d 09 52 | 65 63 74 20 72 2c 73 72 |idth;..R|ect r,sr|
|000006a0| 63 52 65 63 74 2c 64 73 | 74 52 65 63 74 3b 0d 09 |cRect,ds|tRect;..|
|000006b0| 64 6f 75 62 6c 65 20 61 | 2c 62 2c 66 2c 66 4e 6f |double a|,b,f,fNo|
|000006c0| 6d 69 6e 61 6c 2c 63 2c | 4c 2c 63 4f 75 74 2c 63 |minal,c,|L,cOut,c|
|000006d0| 48 5b 31 30 5d 2c 63 56 | 5b 31 30 5d 3b 0d 09 50 |H[10],cV|[10];..P|
|000006e0| 6c 6f 74 58 59 53 74 79 | 6c 65 20 6d 74 66 53 74 |lotXYSty|le mtfSt|
|000006f0| 79 6c 65 5b 32 5d 3b 0d | 09 75 6e 73 69 67 6e 65 |yle[2];.|.unsigne|
|00000700| 64 20 6c 6f 6e 67 20 72 | 6f 77 5b 31 30 34 38 5d |d long r|ow[1048]|
|00000710| 3b 09 2f 2f 20 68 6f 70 | 65 66 75 6c 6c 79 20 6c |;.// hop|efully l|
|00000720| 6f 6e 67 20 65 6e 6f 75 | 67 68 20 66 6f 72 20 61 |ong enou|gh for a|
|00000730| 6e 79 20 76 69 64 65 6f | 20 64 65 76 69 63 65 0d |ny video| device.|
|00000740| 09 73 68 6f 72 74 20 6f | 6c 64 53 63 72 65 65 6e |.short o|ldScreen|
|00000750| 3b 0d 0d 09 61 73 73 65 | 72 74 28 53 74 61 63 6b |;...asse|rt(Stack|
|00000760| 53 70 61 63 65 28 29 3e | 34 30 30 30 29 3b 0d 09 |Space()>|4000);..|
|00000770| 23 69 66 20 28 54 48 49 | 4e 4b 5f 43 20 7c 7c 20 |#if (THI|NK_C || |
|00000780| 54 48 49 4e 4b 5f 43 50 | 4c 55 53 29 0d 09 09 63 |THINK_CP|LUS)...c|
|00000790| 6f 6e 73 6f 6c 65 5f 6f | 70 74 69 6f 6e 73 2e 6e |onsole_o|ptions.n|
|000007a0| 63 6f 6c 73 3d 31 30 30 | 3b 0d 09 09 4d 61 78 69 |cols=100|;...Maxi|
|000007b0| 6d 69 7a 65 43 6f 6e 73 | 6f 6c 65 48 65 69 67 68 |mizeCons|oleHeigh|
|000007c0| 74 28 29 3b 0d 09 09 70 | 72 69 6e 74 66 28 22 5c |t();...p|rintf("\|
|000007d0| 6e 22 29 3b 09 09 20 20 | 20 09 09 09 2f 2a 20 49 |n");.. | .../* I|
|000007e0| 6e 69 74 69 61 6c 69 7a | 65 20 51 75 69 63 6b 44 |nitializ|e QuickD|
|000007f0| 72 61 77 20 2a 2f 0d 09 | 23 65 6c 73 65 0d 09 09 |raw */..|#else...|
|00000800| 49 6e 69 74 47 72 61 66 | 28 26 71 64 2e 74 68 65 |InitGraf|(&qd.the|
|00000810| 50 6f 72 74 29 3b 0d 09 | 09 49 6e 69 74 46 6f 6e |Port);..|.InitFon|
|00000820| 74 73 28 29 3b 0d 09 09 | 49 6e 69 74 57 69 6e 64 |ts();...|InitWind|
|00000830| 6f 77 73 28 29 3b 0d 09 | 09 49 6e 69 74 43 75 72 |ows();..|.InitCur|
|00000840| 73 6f 72 28 29 3b 0d 09 | 23 65 6e 64 69 66 0d 09 |sor();..|#endif..|
|00000850| 23 69 66 20 50 52 4f 46 | 49 4c 45 0d 09 09 49 6e |#if PROF|ILE...In|
|00000860| 69 74 50 72 6f 66 69 6c | 65 28 32 30 30 2c 31 29 |itProfil|e(200,1)|
|00000870| 3b 0d 09 09 5f 70 72 6f | 66 69 6c 65 3d 30 3b 09 |;..._pro|file=0;.|
|00000880| 2f 2a 20 64 69 73 61 62 | 6c 65 20 70 72 6f 66 69 |/* disab|le profi|
|00000890| 6c 69 6e 67 20 66 6f 72 | 20 74 68 65 20 6d 6f 6d |ling for| the mom|
|000008a0| 65 6e 74 20 2a 2f 0d 09 | 23 65 6e 64 69 66 0d 09 |ent */..|#endif..|
|000008b0| 70 72 69 6e 74 66 28 22 | 57 65 6c 63 6f 6d 65 20 |printf("|Welcome |
|000008c0| 74 6f 20 4d 65 61 73 75 | 72 65 4d 54 46 2e 5c 6e |to Measu|reMTF.\n|
|000008d0| 22 29 3b 0d 09 23 69 6e | 63 6c 75 64 65 20 22 4c |");..#in|clude "L|
|000008e0| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 31 2e |uminance|Record1.|
|000008f0| 68 22 09 09 09 09 09 2f | 2f 20 72 65 61 64 20 61 |h"...../|/ read a|
|00000900| 74 20 63 6f 6d 70 69 6c | 65 20 74 69 6d 65 0d 09 |t compil|e time..|
|00000910| 6f 6c 64 53 63 72 65 65 | 6e 3d 4c 52 2e 73 63 72 |oldScree|n=LR.scr|
|00000920| 65 65 6e 3b 0d 09 69 66 | 28 47 65 74 53 63 72 65 |een;..if|(GetScre|
|00000930| 65 6e 44 65 76 69 63 65 | 28 31 29 21 3d 4e 55 4c |enDevice|(1)!=NUL|
|00000940| 4c 29 7b 0d 09 09 70 72 | 69 6e 74 66 28 22 57 68 |L){...pr|intf("Wh|
|00000950| 69 63 68 20 73 63 72 65 | 65 6e 20 77 6f 75 6c 64 |ich scre|en would|
|00000960| 20 79 6f 75 20 6c 69 6b | 65 20 74 6f 20 63 61 6c | you lik|e to cal|
|00000970| 69 62 72 61 74 65 20 28 | 25 64 29 3a 22 2c 4c 52 |ibrate (|%d):",LR|
|00000980| 2e 73 63 72 65 65 6e 29 | 3b 0d 09 09 67 65 74 73 |.screen)|;...gets|
|00000990| 28 73 74 72 69 6e 67 29 | 3b 0d 09 09 73 73 63 61 |(string)|;...ssca|
|000009a0| 6e 66 28 73 74 72 69 6e | 67 2c 22 25 64 22 2c 26 |nf(strin|g,"%d",&|
|000009b0| 4c 52 2e 73 63 72 65 65 | 6e 29 3b 0d 09 7d 0d 09 |LR.scree|n);..}..|
|000009c0| 65 6c 73 65 20 4c 52 2e | 73 63 72 65 65 6e 3d 30 |else LR.|screen=0|
|000009d0| 3b 0d 09 73 70 72 69 6e | 74 66 28 73 74 72 69 6e |;..sprin|tf(strin|
|000009e0| 67 2c 22 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |g,"Lumin|anceReco|
|000009f0| 72 64 25 64 2e 68 22 2c | 4c 52 2e 73 63 72 65 65 |rd%d.h",|LR.scree|
|00000a00| 6e 29 3b 0d 09 69 3d 52 | 65 61 64 4c 75 6d 69 6e |n);..i=R|eadLumin|
|00000a10| 61 6e 63 65 52 65 63 6f | 72 64 28 73 74 72 69 6e |anceReco|rd(strin|
|00000a20| 67 2c 26 4c 52 2c 30 29 | 3b 09 09 2f 2f 20 74 72 |g,&LR,0)|;..// tr|
|00000a30| 79 20 74 6f 20 72 65 61 | 64 20 6c 61 74 65 73 74 |y to rea|d latest|
|00000a40| 20 4c 75 6d 69 6e 61 6e | 63 65 52 65 63 6f 72 64 | Luminan|ceRecord|
|00000a50| 0d 09 69 66 28 69 3c 31 | 29 70 72 69 6e 74 66 28 |..if(i<1|)printf(|
|00000a60| 22 57 61 72 6e 69 6e 67 | 3a 20 63 6f 75 6c 64 6e |"Warning|: couldn|
|00000a70| 27 74 20 66 69 6e 64 20 | d2 25 73 d3 2e 20 43 61 |'t find |.%s.. Ca|
|00000a80| 6c 69 62 72 61 74 69 6e | 67 20 73 63 72 65 65 6e |libratin|g screen|
|00000a90| 20 25 64 2e 5c 6e 22 0d | 09 09 2c 73 74 72 69 6e | %d.\n".|..,strin|
|00000aa0| 67 2c 4c 52 2e 73 63 72 | 65 65 6e 29 3b 0d 09 65 |g,LR.scr|een);..e|
|00000ab0| 6c 73 65 20 6f 6c 64 53 | 63 72 65 65 6e 3d 4c 52 |lse oldS|creen=LR|
|00000ac0| 2e 73 63 72 65 65 6e 3b | 0d 0d 09 6d 74 66 53 74 |.screen;|...mtfSt|
|00000ad0| 79 6c 65 5b 30 5d 2e 63 | 6f 6e 74 69 6e 75 69 6e |yle[0].c|ontinuin|
|00000ae0| 67 3d 30 3b 0d 09 6d 74 | 66 53 74 79 6c 65 5b 30 |g=0;..mt|fStyle[0|
|00000af0| 5d 2e 6c 69 6e 65 57 69 | 64 74 68 3d 31 3b 0d 09 |].lineWi|dth=1;..|
|00000b00| 6d 74 66 53 74 79 6c 65 | 5b 30 5d 2e 73 79 6d 62 |mtfStyle|[0].symb|
|00000b10| 6f 6c 57 69 64 74 68 3d | 30 3b 0d 09 6d 74 66 53 |olWidth=|0;..mtfS|
|00000b20| 74 79 6c 65 5b 30 5d 2e | 64 61 73 68 5b 30 5d 3d |tyle[0].|dash[0]=|
|00000b30| 30 3b 0d 09 6d 74 66 53 | 74 79 6c 65 5b 30 5d 2e |0;..mtfS|tyle[0].|
|00000b40| 64 61 73 68 4f 66 66 73 | 65 74 3d 30 3b 0d 09 6d |dashOffs|et=0;..m|
|00000b50| 74 66 53 74 79 6c 65 5b | 30 5d 2e 63 6f 6c 6f 72 |tfStyle[|0].color|
|00000b60| 3d 62 6c 61 63 6b 43 6f | 6c 6f 72 3b 0d 09 6d 74 |=blackCo|lor;..mt|
|00000b70| 66 53 74 79 6c 65 5b 31 | 5d 3d 6d 74 66 53 74 79 |fStyle[1|]=mtfSty|
|00000b80| 6c 65 5b 30 5d 3b 0d 09 | 6d 74 66 53 74 79 6c 65 |le[0];..|mtfStyle|
|00000b90| 5b 31 5d 2e 63 6f 6c 6f | 72 3d 62 6c 75 65 43 6f |[1].colo|r=blueCo|
|00000ba0| 6c 6f 72 3b 0d 09 0d 09 | 47 65 74 44 61 74 65 54 |lor;....|GetDateT|
|00000bb0| 69 6d 65 28 26 73 65 63 | 6f 6e 64 73 29 3b 0d 09 |ime(&sec|onds);..|
|00000bc0| 73 70 72 69 6e 74 66 28 | 6f 75 74 4e 61 6d 65 2c |sprintf(|outName,|
|00000bd0| 22 4d 54 46 25 64 2e 25 | 73 22 2c 4c 52 2e 73 63 |"MTF%d.%|s",LR.sc|
|00000be0| 72 65 65 6e 2c 44 61 74 | 65 64 53 74 72 69 6e 67 |reen,Dat|edString|
|00000bf0| 28 73 65 63 6f 6e 64 73 | 29 29 3b 0d 09 6f 75 74 |(seconds|));..out|
|00000c00| 66 69 6c 65 5b 30 5d 3d | 73 74 64 6f 75 74 3b 0d |file[0]=|stdout;.|
|00000c10| 09 6f 75 74 66 69 6c 65 | 5b 31 5d 3d 66 6f 70 65 |.outfile|[1]=fope|
|00000c20| 6e 28 6f 75 74 4e 61 6d | 65 2c 22 77 22 29 3b 0d |n(outNam|e,"w");.|
|00000c30| 09 69 66 28 6f 75 74 66 | 69 6c 65 5b 31 5d 3d 3d |.if(outf|ile[1]==|
|00000c40| 4e 55 4c 4c 29 20 50 72 | 69 6e 74 66 45 78 69 74 |NULL) Pr|intfExit|
|00000c50| 28 22 53 6f 72 72 79 2c | 20 63 61 6e 27 74 20 63 |("Sorry,| can't c|
|00000c60| 72 65 61 74 65 20 5c 22 | 25 73 5c 22 2e 5c 30 30 |reate \"|%s\".\00|
|00000c70| 37 5c 6e 22 2c 6f 75 74 | 4e 61 6d 65 29 3b 0d 09 |7\n",out|Name);..|
|00000c80| 53 65 74 46 69 6c 65 49 | 6e 66 6f 28 6f 75 74 4e |SetFileI|nfo(outN|
|00000c90| 61 6d 65 2c 27 54 45 58 | 54 27 2c 27 51 4b 50 54 |ame,'TEX|T','QKPT|
|00000ca0| 27 29 3b 09 2f 2a 20 66 | 6f 72 20 4b 61 6c 65 69 |');./* f|or Kalei|
|00000cb0| 64 61 67 72 61 70 68 20 | 2a 2f 0d 0d 09 2f 2a 20 |dagraph |*/.../* |
|00000cc0| 46 69 6e 64 20 64 65 76 | 69 63 65 20 63 6f 72 72 |Find dev|ice corr|
|00000cd0| 65 73 70 6f 6e 64 69 6e | 67 20 74 6f 20 74 68 65 |espondin|g to the|
|00000ce0| 20 65 78 70 65 72 69 6d | 65 6e 74 61 6c 20 73 63 | experim|ental sc|
|00000cf0| 72 65 65 6e 2e 20 2a 2f | 0d 09 6f 6c 64 47 44 48 |reen. */|..oldGDH|
|00000d00| 61 6e 64 6c 65 3d 47 65 | 74 47 44 65 76 69 63 65 |andle=Ge|tGDevice|
|00000d10| 28 29 3b 0d 09 64 65 76 | 69 63 65 20 3d 20 47 65 |();..dev|ice = Ge|
|00000d20| 74 53 63 72 65 65 6e 44 | 65 76 69 63 65 28 4c 52 |tScreenD|evice(LR|
|00000d30| 2e 73 63 72 65 65 6e 29 | 3b 0d 09 69 66 28 4e 65 |.screen)|;..if(Ne|
|00000d40| 77 50 61 6c 65 74 74 65 | 4d 61 6e 61 67 65 72 28 |wPalette|Manager(|
|00000d50| 29 29 0d 09 09 53 65 74 | 44 65 70 74 68 28 64 65 |))...Set|Depth(de|
|00000d60| 76 69 63 65 2c 38 2c 31 | 2c 31 29 3b 09 2f 2a 20 |vice,8,1|,1);./* |
|00000d70| 38 2d 62 69 74 20 70 69 | 78 65 6c 73 2c 20 63 6f |8-bit pi|xels, co|
|00000d80| 6c 6f 72 20 6d 6f 64 65 | 20 2a 2f 0d 09 77 69 6e |lor mode| */..win|
|00000d90| 64 6f 77 20 3d 20 47 44 | 4f 70 65 6e 57 69 6e 64 |dow = GD|OpenWind|
|00000da0| 6f 77 28 64 65 76 69 63 | 65 29 3b 0d 09 0d 09 69 |ow(devic|e);....i|
|00000db0| 66 28 6f 6c 64 53 63 72 | 65 65 6e 3d 3d 4c 52 2e |f(oldScr|een==LR.|
|00000dc0| 73 63 72 65 65 6e 29 7b | 0d 09 09 70 72 69 6e 74 |screen){|...print|
|00000dd0| 66 28 22 4c 75 6d 69 6e | 61 6e 63 65 20 77 61 73 |f("Lumin|ance was|
|00000de0| 20 63 61 6c 69 62 72 61 | 74 65 64 20 6f 6e 20 25 | calibra|ted on %|
|00000df0| 73 5c 6e 22 2c 4c 52 2e | 64 61 74 65 29 3b 0d 09 |s\n",LR.|date);..|
|00000e00| 09 70 72 69 6e 74 66 28 | 22 61 74 20 25 2e 32 66 |.printf(|"at %.2f|
|00000e10| 20 25 73 20 62 79 20 25 | 73 5c 6e 22 2c 4c 52 2e | %s by %|s\n",LR.|
|00000e20| 4c 42 61 63 6b 67 72 6f | 75 6e 64 2c 4c 52 2e 75 |LBackgro|und,LR.u|
|00000e30| 6e 69 74 73 2c 4c 52 2e | 6e 6f 74 65 73 29 3b 0d |nits,LR.|notes);.|
|00000e40| 09 09 70 72 69 6e 74 66 | 28 22 52 61 6e 67 65 20 |..printf|("Range |
|00000e50| 69 73 20 25 2e 31 66 20 | 74 6f 20 25 2e 31 66 20 |is %.1f |to %.1f |
|00000e60| 25 73 2e 5c 6e 22 2c 4c | 52 2e 4c 4d 69 6e 2c 4c |%s.\n",L|R.LMin,L|
|00000e70| 52 2e 4c 4d 61 78 2c 4c | 52 2e 75 6e 69 74 73 29 |R.LMax,L|R.units)|
|00000e80| 3b 0d 09 7d 0d 09 4c 3d | 4c 52 2e 4c 42 61 63 6b |;..}..L=|LR.LBack|
|00000e90| 67 72 6f 75 6e 64 3b 09 | 2f 2a 20 64 65 73 69 72 |ground;.|/* desir|
|00000ea0| 65 64 20 6d 65 61 6e 20 | 6c 75 6d 69 6e 61 6e 63 |ed mean |luminanc|
|00000eb0| 65 20 2a 2f 0d 09 70 72 | 69 6e 74 66 28 22 45 6e |e */..pr|intf("En|
|00000ec0| 74 65 72 20 64 65 73 69 | 72 65 64 20 64 69 73 70 |ter desi|red disp|
|00000ed0| 6c 61 79 20 6c 75 6d 69 | 6e 61 6e 63 65 20 69 6e |lay lumi|nance in|
|00000ee0| 20 63 64 2f 6d 5e 32 20 | 28 25 2e 32 66 29 3a 22 | cd/m^2 |(%.2f):"|
|00000ef0| 2c 4c 29 3b 0d 09 66 67 | 65 74 73 28 73 74 72 69 |,L);..fg|ets(stri|
|00000f00| 6e 67 2c 73 69 7a 65 6f | 66 28 73 74 72 69 6e 67 |ng,sizeo|f(string|
|00000f10| 29 2d 31 2c 73 74 64 69 | 6e 29 3b 0d 09 73 73 63 |)-1,stdi|n);..ssc|
|00000f20| 61 6e 66 28 73 74 72 69 | 6e 67 2c 22 25 6c 66 22 |anf(stri|ng,"%lf"|
|00000f30| 2c 20 26 4c 29 3b 0d 0d | 09 63 3d 30 2e 39 3b 0d |, &L);..|.c=0.9;.|
|00000f40| 09 63 3d 4d 49 4e 28 63 | 2c 4d 49 4e 28 28 4c 52 |.c=MIN(c|,MIN((LR|
|00000f50| 2e 4c 4d 61 78 2d 4c 29 | 2f 4c 2c 28 4c 2d 4c 52 |.LMax-L)|/L,(L-LR|
|00000f60| 2e 4c 4d 69 6e 29 2f 4c | 29 29 3b 0d 09 70 72 69 |.LMin)/L|));..pri|
|00000f70| 6e 74 66 28 22 43 6f 6e | 74 72 61 73 74 20 25 2e |ntf("Con|trast %.|
|00000f80| 31 66 5c 6e 22 2c 63 29 | 3b 0d 09 70 72 69 6e 74 |1f\n",c)|;..print|
|00000f90| 66 28 22 43 6f 6d 70 75 | 74 69 6e 67 20 73 69 6e |f("Compu|ting sin|
|00000fa0| 75 73 6f 69 64 61 6c 20 | 6c 6f 6f 6b 75 70 20 74 |usoidal |lookup t|
|00000fb0| 61 62 6c 65 20 2e 20 2e | 20 2e 5c 6e 22 29 3b 0d |able . .| .\n");.|
|00000fc0| 09 66 6f 72 28 69 3d 30 | 3b 69 3c 32 35 36 3b 69 |.for(i=0|;i<256;i|
|00000fd0| 2b 2b 29 7b 0d 09 09 53 | 65 74 4c 75 6d 69 6e 61 |++){...S|etLumina|
|00000fe0| 6e 63 65 28 64 65 76 69 | 63 65 2c 26 4c 52 2c 69 |nce(devi|ce,&LR,i|
|00000ff0| 2c 4c 2a 28 31 2e 30 2b | 63 2a 73 69 6e 28 54 57 |,L*(1.0+|c*sin(TW|
|00001000| 4f 5f 50 49 2a 69 2f 32 | 35 36 2e 30 29 29 2c 4c |O_PI*i/2|56.0)),L|
|00001010| 2a 28 31 2e 30 2d 63 29 | 2c 4c 2a 28 31 2e 30 2b |*(1.0-c)|,L*(1.0+|
|00001020| 63 29 29 3b 0d 09 7d 0d | 0d 09 74 50 65 72 69 6f |c));..}.|..tPerio|
|00001030| 64 3d 36 34 3b 09 09 09 | 09 09 09 09 09 09 2f 2a |d=64;...|....../*|
|00001040| 20 66 72 61 6d 65 73 20 | 69 6e 20 6f 6e 65 20 74 | frames |in one t|
|00001050| 65 6d 70 6f 72 61 6c 20 | 70 65 72 69 6f 64 20 2a |emporal |period *|
|00001060| 2f 0d 09 77 69 64 74 68 | 3d 77 69 6e 64 6f 77 2d |/..width|=window-|
|00001070| 3e 70 6f 72 74 52 65 63 | 74 2e 72 69 67 68 74 3b |>portRec|t.right;|
|00001080| 09 09 09 09 2f 2a 20 70 | 69 78 65 6c 73 20 61 63 |..../* p|ixels ac|
|00001090| 72 6f 73 73 20 73 63 72 | 65 65 6e 20 2a 2f 0d 09 |ross scr|een */..|
|000010a0| 53 65 74 52 65 63 74 28 | 26 72 2c 30 2c 30 2c 32 |SetRect(|&r,0,0,2|
|000010b0| 2a 74 50 65 72 69 6f 64 | 2c 32 2a 74 50 65 72 69 |*tPeriod|,2*tPeri|
|000010c0| 6f 64 29 3b 0d 09 4f 66 | 66 73 65 74 52 65 63 74 |od);..Of|fsetRect|
|000010d0| 28 26 72 2c 36 34 2c 36 | 34 29 3b 0d 09 70 6c 6f |(&r,64,6|4);..plo|
|000010e0| 74 57 69 6e 64 6f 77 3d | 4e 65 77 57 69 6e 64 6f |tWindow=|NewWindo|
|000010f0| 77 28 4e 55 4c 4c 2c 26 | 72 2c 22 5c 70 4c 22 2c |w(NULL,&|r,"\pL",|
|00001100| 31 2c 6e 6f 47 72 6f 77 | 44 6f 63 50 72 6f 63 2c |1,noGrow|DocProc,|
|00001110| 28 57 69 6e 64 6f 77 50 | 74 72 29 20 2d 31 4c 2c |(WindowP|tr) -1L,|
|00001120| 46 41 4c 53 45 2c 30 4c | 29 3b 0d 09 53 65 74 52 |FALSE,0L|);..SetR|
|00001130| 65 63 74 28 26 72 2c 30 | 2c 30 2c 31 39 32 2c 31 |ect(&r,0|,0,192,1|
|00001140| 39 32 29 3b 0d 09 4f 66 | 66 73 65 74 52 65 63 74 |92);..Of|fsetRect|
|00001150| 28 26 72 2c 36 34 30 2d | 72 2e 72 69 67 68 74 2d |(&r,640-|r.right-|
|00001160| 36 34 2c 36 34 29 3b 0d | 09 6d 74 66 57 69 6e 64 |64,64);.|.mtfWind|
|00001170| 6f 77 3d 4e 65 77 57 69 | 6e 64 6f 77 28 4e 55 4c |ow=NewWi|ndow(NUL|
|00001180| 4c 2c 26 72 2c 22 5c 70 | 4d 54 46 22 2c 31 2c 6e |L,&r,"\p|MTF",1,n|
|00001190| 6f 47 72 6f 77 44 6f 63 | 50 72 6f 63 2c 28 57 69 |oGrowDoc|Proc,(Wi|
|000011a0| 6e 64 6f 77 50 74 72 29 | 20 2d 31 4c 2c 46 41 4c |ndowPtr)| -1L,FAL|
|000011b0| 53 45 2c 30 4c 29 3b 0d | 09 4d 65 61 73 75 72 65 |SE,0L);.|.Measure|
|000011c0| 43 6f 6e 74 72 61 73 74 | 28 64 65 76 69 63 65 2c |Contrast|(device,|
|000011d0| 26 4c 52 2c 74 50 65 72 | 69 6f 64 2c 63 48 2c 70 |&LR,tPer|iod,cH,p|
|000011e0| 6c 6f 74 57 69 6e 64 6f | 77 29 3b 09 09 2f 2a 20 |lotWindo|w);../* |
|000011f0| 6d 65 61 73 75 72 65 20 | 76 42 6c 61 63 6b 20 2a |measure |vBlack *|
|00001200| 2f 0d 09 66 66 70 72 69 | 6e 74 66 28 6f 75 74 66 |/..ffpri|ntf(outf|
|00001210| 69 6c 65 2c 0d 09 09 22 | 6e 6f 74 65 73 22 20 22 |ile,..."|notes" "|
|00001220| 5c 74 63 79 63 6c 65 73 | 2f 70 69 78 65 6c 22 20 |\tcycles|/pixel" |
|00001230| 22 5c 74 63 79 63 6c 65 | 73 2f 73 63 72 65 65 6e |"\tcycle|s/screen|
|00001240| 22 20 0d 09 09 22 5c 74 | 48 6f 72 69 7a 2e 20 47 |" ..."\t|Horiz. G|
|00001250| 72 61 74 69 6e 67 20 47 | 61 69 6e 22 20 22 5c 74 |rating G|ain" "\t|
|00001260| 56 65 72 74 2e 20 47 72 | 61 74 69 6e 67 20 47 61 |Vert. Gr|ating Ga|
|00001270| 69 6e 22 20 22 5c 74 56 | 65 72 74 2e 2f 48 6f 72 |in" "\tV|ert./Hor|
|00001280| 69 7a 2e 22 29 3b 0d 09 | 66 70 72 69 6e 74 66 28 |iz.");..|fprintf(|
|00001290| 6f 75 74 66 69 6c 65 5b | 30 5d 2c 22 5c 6e 22 29 |outfile[|0],"\n")|
|000012a0| 3b 0d 09 66 70 72 69 6e | 74 66 28 6f 75 74 66 69 |;..fprin|tf(outfi|
|000012b0| 6c 65 5b 31 5d 2c 22 5c | 74 63 22 20 22 5c 74 63 |le[1],"\|tc" "\tc|
|000012c0| 48 5b 30 5d 22 20 22 5c | 74 63 48 5b 31 5d 22 20 |H[0]" "\|tcH[1]" |
|000012d0| 22 5c 74 63 48 5b 32 5d | 22 20 22 5c 74 63 56 5b |"\tcH[2]|" "\tcV[|
|000012e0| 30 5d 22 20 22 5c 74 63 | 56 5b 31 5d 22 20 22 5c |0]" "\tc|V[1]" "\|
|000012f0| 74 63 56 5b 32 5d 22 20 | 0d 09 09 22 5c 74 28 63 |tcV[2]" |..."\t(c|
|00001300| 56 5b 30 5d 2d 63 48 5b | 30 5d 29 2f 63 48 5b 30 |V[0]-cH[|0])/cH[0|
|00001310| 5d 22 20 22 5c 74 63 56 | 5b 32 5d 2f 28 63 2a 56 |]" "\tcV|[2]/(c*V|
|00001320| 2f 48 29 5e 32 22 20 22 | 5c 74 28 63 56 5b 30 5d |/H)^2" "|\t(cV[0]|
|00001330| 2d 63 48 5b 30 5d 29 2f | 63 48 5b 30 5d 2f 28 63 |-cH[0])/|cH[0]/(c|
|00001340| 2a 56 2f 48 29 5e 32 22 | 0d 09 09 22 5c 6e 22 29 |*V/H)^2"|..."\n")|
|00001350| 3b 0d 09 66 66 70 72 69 | 6e 74 66 28 6f 75 74 66 |;..ffpri|ntf(outf|
|00001360| 69 6c 65 2c 22 6e 6f 74 | 65 73 22 29 3b 09 2f 2a |ile,"not|es");./*|
|00001370| 20 70 75 74 20 73 6f 6d | 65 20 74 65 78 74 20 69 | put som|e text i|
|00001380| 6e 20 6e 6f 74 65 73 20 | 63 6f 6c 75 6d 6e 20 2a |n notes |column *|
|00001390| 2f 0d 09 66 6f 72 28 66 | 4e 6f 6d 69 6e 61 6c 3d |/..for(f|Nominal=|
|000013a0| 30 2e 30 3b 3b 66 4e 6f | 6d 69 6e 61 6c 3d 4d 41 |0.0;;fNo|minal=MA|
|000013b0| 58 28 66 4e 6f 6d 69 6e | 61 6c 2a 70 6f 77 28 32 |X(fNomin|al*pow(2|
|000013c0| 2e 30 2c 31 2e 30 2f 32 | 2e 30 29 2c 66 4e 6f 6d |.0,1.0/2|.0),fNom|
|000013d0| 69 6e 61 6c 2b 31 2e 30 | 2f 77 69 64 74 68 29 29 |inal+1.0|/width))|
|000013e0| 7b 0d 09 09 66 3d 66 6c | 6f 6f 72 28 66 4e 6f 6d |{...f=fl|oor(fNom|
|000013f0| 69 6e 61 6c 2a 77 69 64 | 74 68 2b 30 2e 35 29 2f |inal*wid|th+0.5)/|
|00001400| 77 69 64 74 68 3b 20 2f | 2a 20 69 6e 74 65 67 72 |width; /|* integr|
|00001410| 61 6c 20 70 65 72 69 6f | 64 73 20 66 6f 72 20 7a |al perio|ds for z|
|00001420| 65 72 6f 20 6d 65 61 6e | 20 6f 76 65 72 20 6c 69 |ero mean| over li|
|00001430| 6e 65 20 2a 2f 0d 09 09 | 69 66 28 66 4e 6f 6d 69 |ne */...|if(fNomi|
|00001440| 6e 61 6c 3e 30 2e 35 29 | 66 3d 30 2e 35 3b 0d 09 |nal>0.5)|f=0.5;..|
|00001450| 09 2f 2a 20 68 6f 72 69 | 7a 6f 6e 74 61 6c 20 67 |./* hori|zontal g|
|00001460| 72 61 74 69 6e 67 20 2a | 2f 0d 09 09 73 72 63 52 |rating *|/...srcR|
|00001470| 65 63 74 3d 64 73 74 52 | 65 63 74 3d 77 69 6e 64 |ect=dstR|ect=wind|
|00001480| 6f 77 2d 3e 70 6f 72 74 | 52 65 63 74 3b 0d 09 09 |ow->port|Rect;...|
|00001490| 64 73 74 52 65 63 74 2e | 6c 65 66 74 3d 73 72 63 |dstRect.|left=src|
|000014a0| 52 65 63 74 2e 72 69 67 | 68 74 3d 31 3b 0d 09 09 |Rect.rig|ht=1;...|
|000014b0| 66 6f 72 28 69 3d 30 3b | 69 3c 73 72 63 52 65 63 |for(i=0;|i<srcRec|
|000014c0| 74 2e 62 6f 74 74 6f 6d | 3b 69 2b 2b 29 7b 0d 09 |t.bottom|;i++){..|
|000014d0| 09 09 72 6f 77 5b 30 5d | 3d 31 32 38 2e 30 2b 31 |..row[0]|=128.0+1|
|000014e0| 32 37 2e 35 2a 73 61 77 | 28 54 57 4f 5f 50 49 2a |27.5*saw|(TWO_PI*|
|000014f0| 66 2a 69 29 3b 0d 09 09 | 09 53 65 74 57 69 6e 64 |f*i);...|.SetWind|
|00001500| 6f 77 50 69 78 65 6c 73 | 51 75 69 63 6b 6c 79 28 |owPixels|Quickly(|
|00001510| 28 57 69 6e 64 6f 77 50 | 74 72 29 77 69 6e 64 6f |(WindowP|tr)windo|
|00001520| 77 2c 30 2c 69 2c 72 6f | 77 2c 31 29 3b 0d 09 09 |w,0,i,ro|w,1);...|
|00001530| 7d 0d 09 09 2f 2a 20 43 | 6f 70 79 42 69 74 73 20 |}.../* C|opyBits |
|00001540| 75 73 65 73 20 74 68 65 | 20 69 6e 76 65 72 73 65 |uses the| inverse|
|00001550| 20 63 6f 6c 6f 72 20 74 | 61 62 6c 65 20 6f 66 20 | color t|able of |
|00001560| 74 68 65 20 63 75 72 72 | 65 6e 74 20 47 44 65 76 |the curr|ent GDev|
|00001570| 69 63 65 2e 20 2a 2f 0d | 09 09 53 65 74 47 44 65 |ice. */.|..SetGDe|
|00001580| 76 69 63 65 28 64 65 76 | 69 63 65 29 3b 0d 09 09 |vice(dev|ice);...|
|00001590| 43 6f 70 79 42 69 74 73 | 28 28 42 69 74 4d 61 70 |CopyBits|((BitMap|
|000015a0| 20 2a 29 2a 77 69 6e 64 | 6f 77 2d 3e 70 6f 72 74 | *)*wind|ow->port|
|000015b0| 50 69 78 4d 61 70 2c 28 | 42 69 74 4d 61 70 20 2a |PixMap,(|BitMap *|
|000015c0| 29 2a 77 69 6e 64 6f 77 | 2d 3e 70 6f 72 74 50 69 |)*window|->portPi|
|000015d0| 78 4d 61 70 2c 0d 09 09 | 09 26 73 72 63 52 65 63 |xMap,...|.&srcRec|
|000015e0| 74 2c 26 64 73 74 52 65 | 63 74 2c 73 72 63 43 6f |t,&dstRe|ct,srcCo|
|000015f0| 70 79 2c 4e 55 4c 4c 29 | 3b 0d 09 09 53 65 74 47 |py,NULL)|;...SetG|
|00001600| 44 65 76 69 63 65 28 6f | 6c 64 47 44 48 61 6e 64 |Device(o|ldGDHand|
|00001610| 6c 65 29 3b 0d 09 09 63 | 4f 75 74 3d 4d 65 61 73 |le);...c|Out=Meas|
|00001620| 75 72 65 43 6f 6e 74 72 | 61 73 74 28 64 65 76 69 |ureContr|ast(devi|
|00001630| 63 65 2c 26 4c 52 2c 74 | 50 65 72 69 6f 64 2c 63 |ce,&LR,t|Period,c|
|00001640| 48 2c 70 6c 6f 74 57 69 | 6e 64 6f 77 29 3b 0d 09 |H,plotWi|ndow);..|
|00001650| 09 66 66 70 72 69 6e 74 | 66 28 6f 75 74 66 69 6c |.ffprint|f(outfil|
|00001660| 65 2c 22 5c 74 25 31 30 | 2e 35 66 22 20 22 5c 74 |e,"\t%10|.5f" "\t|
|00001670| 25 31 30 2e 32 66 22 20 | 22 5c 74 25 31 32 2e 36 |%10.2f" |"\t%12.6|
|00001680| 66 22 2c 66 2c 66 2a 64 | 73 74 52 65 63 74 2e 72 |f",f,f*d|stRect.r|
|00001690| 69 67 68 74 2c 63 4f 75 | 74 2f 63 29 3b 0d 09 09 |ight,cOu|t/c);...|
|000016a0| 2f 2a 20 64 72 61 77 20 | 74 68 65 20 4d 54 46 20 |/* draw |the MTF |
|000016b0| 2a 2f 0d 09 09 50 6c 6f | 74 58 59 28 6d 74 66 57 |*/...Plo|tXY(mtfW|
|000016c0| 69 6e 64 6f 77 0d 09 09 | 09 2c 6c 6f 67 28 66 2f |indow...|.,log(f/|
|000016d0| 28 31 2e 2f 36 34 30 2e | 29 29 2f 6c 6f 67 28 30 |(1./640.|))/log(0|
|000016e0| 2e 35 2f 28 31 2e 2f 36 | 34 30 2e 29 29 2c 20 6c |.5/(1./6|40.)), l|
|000016f0| 6f 67 28 63 4f 75 74 2f | 63 2f 30 2e 33 29 2f 6c |og(cOut/|c/0.3)/l|
|00001700| 6f 67 28 31 2e 31 2f 30 | 2e 33 29 0d 09 09 09 2c |og(1.1/0|.3)....,|
|00001710| 26 6d 74 66 53 74 79 6c | 65 5b 30 5d 29 3b 0d 0d |&mtfStyl|e[0]);..|
|00001720| 09 09 2f 2a 20 76 65 72 | 74 69 63 61 6c 20 67 72 |../* ver|tical gr|
|00001730| 61 74 69 6e 67 20 2a 2f | 0d 09 09 73 72 63 52 65 |ating */|...srcRe|
|00001740| 63 74 3d 64 73 74 52 65 | 63 74 3d 77 69 6e 64 6f |ct=dstRe|ct=windo|
|00001750| 77 2d 3e 70 6f 72 74 52 | 65 63 74 3b 0d 09 09 64 |w->portR|ect;...d|
|00001760| 73 74 52 65 63 74 2e 62 | 6f 74 74 6f 6d 3d 73 72 |stRect.b|ottom=sr|
|00001770| 63 52 65 63 74 2e 74 6f | 70 3d 73 72 63 52 65 63 |cRect.to|p=srcRec|
|00001780| 74 2e 62 6f 74 74 6f 6d | 2d 31 3b 0d 09 09 66 6f |t.bottom|-1;...fo|
|00001790| 72 28 69 3d 30 3b 69 3c | 73 72 63 52 65 63 74 2e |r(i=0;i<|srcRect.|
|000017a0| 72 69 67 68 74 3b 69 2b | 2b 29 72 6f 77 5b 69 5d |right;i+|+)row[i]|
|000017b0| 3d 31 32 38 2e 30 2b 31 | 32 37 2e 35 2a 73 61 77 |=128.0+1|27.5*saw|
|000017c0| 28 54 57 4f 5f 50 49 2a | 66 2a 69 29 3b 0d 09 09 |(TWO_PI*|f*i);...|
|000017d0| 53 65 74 57 69 6e 64 6f | 77 50 69 78 65 6c 73 51 |SetWindo|wPixelsQ|
|000017e0| 75 69 63 6b 6c 79 28 28 | 57 69 6e 64 6f 77 50 74 |uickly((|WindowPt|
|000017f0| 72 29 77 69 6e 64 6f 77 | 2c 30 2c 73 72 63 52 65 |r)window|,0,srcRe|
|00001800| 63 74 2e 74 6f 70 2c 72 | 6f 77 2c 73 72 63 52 65 |ct.top,r|ow,srcRe|
|00001810| 63 74 2e 72 69 67 68 74 | 29 3b 0d 09 09 53 65 74 |ct.right|);...Set|
|00001820| 47 44 65 76 69 63 65 28 | 64 65 76 69 63 65 29 3b |GDevice(|device);|
|00001830| 0d 09 09 43 6f 70 79 42 | 69 74 73 28 28 42 69 74 |...CopyB|its((Bit|
|00001840| 4d 61 70 20 2a 29 2a 77 | 69 6e 64 6f 77 2d 3e 70 |Map *)*w|indow->p|
|00001850| 6f 72 74 50 69 78 4d 61 | 70 2c 28 42 69 74 4d 61 |ortPixMa|p,(BitMa|
|00001860| 70 20 2a 29 2a 77 69 6e | 64 6f 77 2d 3e 70 6f 72 |p *)*win|dow->por|
|00001870| 74 50 69 78 4d 61 70 2c | 0d 09 09 09 26 73 72 63 |tPixMap,|....&src|
|00001880| 52 65 63 74 2c 26 64 73 | 74 52 65 63 74 2c 73 72 |Rect,&ds|tRect,sr|
|00001890| 63 43 6f 70 79 2c 4e 55 | 4c 4c 29 3b 0d 09 09 53 |cCopy,NU|LL);...S|
|000018a0| 65 74 47 44 65 76 69 63 | 65 28 6f 6c 64 47 44 48 |etGDevic|e(oldGDH|
|000018b0| 61 6e 64 6c 65 29 3b 0d | 09 09 63 4f 75 74 3d 4d |andle);.|..cOut=M|
|000018c0| 65 61 73 75 72 65 43 6f | 6e 74 72 61 73 74 28 64 |easureCo|ntrast(d|
|000018d0| 65 76 69 63 65 2c 26 4c | 52 2c 74 50 65 72 69 6f |evice,&L|R,tPerio|
|000018e0| 64 2c 63 56 2c 70 6c 6f | 74 57 69 6e 64 6f 77 29 |d,cV,plo|tWindow)|
|000018f0| 3b 0d 09 09 66 66 70 72 | 69 6e 74 66 28 6f 75 74 |;...ffpr|intf(out|
|00001900| 66 69 6c 65 2c 22 5c 74 | 25 32 30 2e 36 66 22 20 |file,"\t|%20.6f" |
|00001910| 22 5c 74 25 31 38 2e 36 | 66 22 2c 63 4f 75 74 2f |"\t%18.6|f",cOut/|
|00001920| 63 2c 63 56 5b 31 5d 2f | 63 48 5b 31 5d 29 3b 0d |c,cV[1]/|cH[1]);.|
|00001930| 09 09 66 70 72 69 6e 74 | 66 28 6f 75 74 66 69 6c |..fprint|f(outfil|
|00001940| 65 5b 30 5d 2c 22 5c 6e | 22 29 3b 0d 09 09 66 70 |e[0],"\n|");...fp|
|00001950| 72 69 6e 74 66 28 6f 75 | 74 66 69 6c 65 5b 31 5d |rintf(ou|tfile[1]|
|00001960| 2c 22 5c 74 25 66 22 20 | 22 5c 74 25 66 22 20 22 |,"\t%f" |"\t%f" "|
|00001970| 5c 74 25 66 22 20 22 5c | 74 25 66 22 20 22 5c 74 |\t%f" "\|t%f" "\t|
|00001980| 25 66 22 20 22 5c 74 25 | 66 22 20 22 5c 74 25 66 |%f" "\t%|f" "\t%f|
|00001990| 22 0d 09 09 09 2c 63 2c | 63 48 5b 30 5d 2c 63 48 |"....,c,|cH[0],cH|
|000019a0| 5b 31 5d 2c 63 48 5b 32 | 5d 2c 63 56 5b 30 5d 2c |[1],cH[2|],cV[0],|
|000019b0| 63 56 5b 31 5d 2c 63 56 | 5b 32 5d 29 3b 0d 09 09 |cV[1],cV|[2]);...|
|000019c0| 61 3d 28 63 56 5b 30 5d | 2d 63 48 5b 30 5d 29 2f |a=(cV[0]|-cH[0])/|
|000019d0| 63 48 5b 30 5d 3b 09 2f | 2a 20 64 63 20 65 72 72 |cH[0];./|* dc err|
|000019e0| 6f 72 2c 20 65 78 70 72 | 65 73 73 65 64 20 61 73 |or, expr|essed as|
|000019f0| 20 61 20 63 6f 6e 74 72 | 61 73 74 20 2a 2f 0d 09 | a contr|ast */..|
|00001a00| 09 62 3d 63 56 5b 31 5d | 2f 63 48 5b 31 5d 3b 09 |.b=cV[1]|/cH[1];.|
|00001a10| 09 09 2f 2a 20 63 6f 6e | 74 72 61 73 74 20 67 61 |../* con|trast ga|
|00001a20| 69 6e 20 6f 66 20 76 69 | 64 65 6f 20 61 6d 70 6c |in of vi|deo ampl|
|00001a30| 69 66 69 65 72 20 2a 2f | 0d 09 09 66 70 72 69 6e |ifier */|...fprin|
|00001a40| 74 66 28 6f 75 74 66 69 | 6c 65 5b 31 5d 2c 22 5c |tf(outfi|le[1],"\|
|00001a50| 74 25 66 22 20 22 5c 74 | 25 66 22 20 22 5c 74 25 |t%f" "\t|%f" "\t%|
|00001a60| 66 22 20 22 5c 6e 22 0d | 09 09 09 2c 61 2c 63 56 |f" "\n".|...,a,cV|
|00001a70| 5b 32 5d 2f 28 63 2a 62 | 2a 63 2a 62 29 2c 61 2f |[2]/(c*b|*c*b),a/|
|00001a80| 28 63 2a 62 2a 63 2a 62 | 29 29 3b 0d 09 09 2f 2a |(c*b*c*b|));.../*|
|00001a90| 20 64 72 61 77 20 74 68 | 65 20 4d 54 46 20 2a 2f | draw th|e MTF */|
|00001aa0| 0d 09 09 50 6c 6f 74 58 | 59 28 6d 74 66 57 69 6e |...PlotX|Y(mtfWin|
|00001ab0| 64 6f 77 0d 09 09 09 2c | 6c 6f 67 28 66 2f 28 31 |dow....,|log(f/(1|
|00001ac0| 2e 2f 36 34 30 2e 29 29 | 2f 6c 6f 67 28 30 2e 35 |./640.))|/log(0.5|
|00001ad0| 2f 28 31 2e 2f 36 34 30 | 2e 29 29 2c 20 6c 6f 67 |/(1./640|.)), log|
|00001ae0| 28 63 4f 75 74 2f 63 2f | 30 2e 33 29 2f 6c 6f 67 |(cOut/c/|0.3)/log|
|00001af0| 28 31 2e 31 2f 30 2e 33 | 29 0d 09 09 09 2c 26 6d |(1.1/0.3|)....,&m|
|00001b00| 74 66 53 74 79 6c 65 5b | 31 5d 29 3b 0d 09 09 0d |tfStyle[|1]);....|
|00001b10| 09 09 69 66 28 66 3d 3d | 30 2e 35 29 62 72 65 61 |..if(f==|0.5)brea|
|00001b20| 6b 3b 0d 09 7d 0d 09 0d | 09 2f 2a 20 70 72 69 6e |k;..}...|./* prin|
|00001b30| 74 20 6e 6f 74 65 73 20 | 2a 2f 0d 09 49 55 44 61 |t notes |*/..IUDa|
|00001b40| 74 65 53 74 72 69 6e 67 | 28 73 65 63 6f 6e 64 73 |teString|(seconds|
|00001b50| 2c 6c 6f 6e 67 44 61 74 | 65 2c 28 75 6e 73 69 67 |,longDat|e,(unsig|
|00001b60| 6e 65 64 20 63 68 61 72 | 20 2a 29 73 74 72 69 6e |ned char| *)strin|
|00001b70| 67 29 3b 0d 09 70 32 63 | 73 74 72 28 28 75 6e 73 |g);..p2c|str((uns|
|00001b80| 69 67 6e 65 64 20 63 68 | 61 72 20 2a 29 73 74 72 |igned ch|ar *)str|
|00001b90| 69 6e 67 29 3b 0d 09 49 | 55 54 69 6d 65 53 74 72 |ing);..I|UTimeStr|
|00001ba0| 69 6e 67 28 73 65 63 6f | 6e 64 73 2c 46 41 4c 53 |ing(seco|nds,FALS|
|00001bb0| 45 2c 28 75 6e 73 69 67 | 6e 65 64 20 63 68 61 72 |E,(unsig|ned char|
|00001bc0| 20 2a 29 73 74 72 69 6e | 67 32 29 3b 0d 09 70 32 | *)strin|g2);..p2|
|00001bd0| 63 73 74 72 28 28 75 6e | 73 69 67 6e 65 64 20 63 |cstr((un|signed c|
|00001be0| 68 61 72 20 2a 29 73 74 | 72 69 6e 67 32 29 3b 0d |har *)st|ring2);.|
|00001bf0| 09 66 66 70 72 69 6e 74 | 66 28 6f 75 74 66 69 6c |.ffprint|f(outfil|
|00001c00| 65 2c 22 25 73 20 25 73 | 5c 6e 22 2c 73 74 72 69 |e,"%s %s|\n",stri|
|00001c10| 6e 67 32 2c 73 74 72 69 | 6e 67 29 3b 0d 09 66 66 |ng2,stri|ng);..ff|
|00001c20| 70 72 69 6e 74 66 28 6f | 75 74 66 69 6c 65 2c 22 |printf(o|utfile,"|
|00001c30| 25 2e 31 66 20 48 7a 5c | 6e 22 2c 31 2e 30 2f 28 |%.1f Hz\|n",1.0/(|
|00001c40| 74 50 65 72 69 6f 64 2a | 30 2e 30 31 35 29 29 3b |tPeriod*|0.015));|
|00001c50| 0d 09 66 66 70 72 69 6e | 74 66 28 6f 75 74 66 69 |..ffprin|tf(outfi|
|00001c60| 6c 65 2c 22 25 2e 32 66 | 20 63 64 2f 6d 5e 32 5c |le,"%.2f| cd/m^2\|
|00001c70| 6e 22 2c 4c 29 3b 0d 09 | 66 66 70 72 69 6e 74 66 |n",L);..|ffprintf|
|00001c80| 28 6f 75 74 66 69 6c 65 | 2c 22 25 2e 33 66 20 63 |(outfile|,"%.3f c|
|00001c90| 6f 6e 74 72 61 73 74 5c | 6e 22 2c 63 29 3b 0d 09 |ontrast\|n",c);..|
|00001ca0| 66 66 70 72 69 6e 74 66 | 28 6f 75 74 66 69 6c 65 |ffprintf|(outfile|
|00001cb0| 2c 22 5c 6e 22 20 22 73 | 63 72 65 65 6e 20 25 64 |,"\n" "s|creen %d|
|00001cc0| 5c 6e 22 2c 4c 52 2e 73 | 63 72 65 65 6e 29 3b 0d |\n",LR.s|creen);.|
|00001cd0| 09 66 66 70 72 69 6e 74 | 66 28 6f 75 74 66 69 6c |.ffprint|f(outfil|
|00001ce0| 65 2c 22 5c 22 25 73 5c | 22 20 6d 6f 6e 69 74 6f |e,"\"%s\|" monito|
|00001cf0| 72 20 25 73 5c 6e 22 2c | 4c 52 2e 6e 61 6d 65 2c |r %s\n",|LR.name,|
|00001d00| 4c 52 2e 69 64 29 3b 0d | 09 66 66 70 72 69 6e 74 |LR.id);.|.ffprint|
|00001d10| 66 28 6f 75 74 66 69 6c | 65 2c 22 6f 6e 20 25 73 |f(outfil|e,"on %s|
|00001d20| 5c 6e 22 2c 4c 52 2e 64 | 61 74 65 29 3b 0d 09 66 |\n",LR.d|ate);..f|
|00001d30| 66 70 72 69 6e 74 66 28 | 6f 75 74 66 69 6c 65 2c |fprintf(|outfile,|
|00001d40| 22 62 79 20 25 73 5c 6e | 22 2c 4c 52 2e 6e 6f 74 |"by %s\n|",LR.not|
|00001d50| 65 73 29 3b 0d 09 66 66 | 70 72 69 6e 74 66 28 6f |es);..ff|printf(o|
|00001d60| 75 74 66 69 6c 65 2c 22 | 61 74 20 25 2e 32 66 20 |utfile,"|at %.2f |
|00001d70| 25 73 5c 6e 22 2c 4c 52 | 2e 4c 42 61 63 6b 67 72 |%s\n",LR|.LBackgr|
|00001d80| 6f 75 6e 64 2c 4c 52 2e | 75 6e 69 74 73 29 3b 0d |ound,LR.|units);.|
|00001d90| 0d 09 47 44 44 69 73 70 | 6f 73 65 57 69 6e 64 6f |..GDDisp|oseWindo|
|00001da0| 77 28 77 69 6e 64 6f 77 | 29 3b 0d 09 69 66 28 6f |w(window|);..if(o|
|00001db0| 75 74 66 69 6c 65 5b 31 | 5d 20 21 3d 20 4e 55 4c |utfile[1|] != NUL|
|00001dc0| 4c 29 66 63 6c 6f 73 65 | 28 6f 75 74 66 69 6c 65 |L)fclose|(outfile|
|00001dd0| 5b 31 5d 29 3b 0d 09 70 | 72 69 6e 74 66 28 22 54 |[1]);..p|rintf("T|
|00001de0| 68 65 20 73 75 6d 20 6f | 66 20 74 68 65 20 74 69 |he sum o|f the ti|
|00001df0| 6d 65 73 20 66 6f 72 20 | 47 65 74 56 6f 6c 74 61 |mes for |GetVolta|
|00001e00| 67 65 28 29 20 61 6e 64 | 20 4c 6f 61 64 4c 75 6d |ge() and| LoadLum|
|00001e10| 69 6e 61 6e 63 65 73 28 | 29 20 73 68 6f 75 6c 64 |inances(|) should|
|00001e20| 5c 6e 22 0d 09 09 22 62 | 65 20 61 62 6f 75 74 20 |\n"..."b|e about |
|00001e30| 6f 6e 65 20 66 72 61 6d | 65 2c 20 31 35 20 6d 73 |one fram|e, 15 ms|
|00001e40| 2e 20 49 66 20 69 74 27 | 73 20 6c 6f 6e 67 65 72 |. If it'|s longer|
|00001e50| 2c 20 65 2e 67 2e 20 33 | 30 20 6d 73 2c 20 79 6f |, e.g. 3|0 ms, yo|
|00001e60| 75 20 73 68 6f 75 6c 64 | 20 72 65 64 75 63 65 5c |u should| reduce\|
|00001e70| 6e 22 0d 09 09 22 74 68 | 65 20 76 61 6c 75 65 20 |n"..."th|e value |
|00001e80| 6f 66 20 5c 22 66 72 61 | 6d 65 73 5c 22 20 69 6e |of \"fra|mes\" in|
|00001e90| 20 4d 65 61 73 75 72 65 | 43 6f 6e 74 72 61 73 74 | Measure|Contrast|
|00001ea0| 28 29 2e 5c 6e 22 29 3b | 0d 09 44 69 73 70 6f 73 |().\n");|..Dispos|
|00001eb0| 65 57 69 6e 64 6f 77 28 | 70 6c 6f 74 57 69 6e 64 |eWindow(|plotWind|
|00001ec0| 6f 77 29 3b 0d 09 44 69 | 73 70 6f 73 65 57 69 6e |ow);..Di|sposeWin|
|00001ed0| 64 6f 77 28 6d 74 66 57 | 69 6e 64 6f 77 29 3b 0d |dow(mtfW|indow);.|
|00001ee0| 7d 0d 0d 0d 64 6f 75 62 | 6c 65 20 4d 65 61 73 75 |}...doub|le Measu|
|00001ef0| 72 65 43 6f 6e 74 72 61 | 73 74 28 47 44 48 61 6e |reContra|st(GDHan|
|00001f00| 64 6c 65 20 64 65 76 69 | 63 65 2c 4c 75 6d 69 6e |dle devi|ce,Lumin|
|00001f10| 61 6e 63 65 52 65 63 6f | 72 64 20 2a 4c 50 0d 09 |anceReco|rd *LP..|
|00001f20| 2c 69 6e 74 20 74 50 65 | 72 69 6f 64 2c 64 6f 75 |,int tPe|riod,dou|
|00001f30| 62 6c 65 20 63 5b 31 30 | 5d 2c 57 69 6e 64 6f 77 |ble c[10|],Window|
|00001f40| 50 74 72 20 70 6c 6f 74 | 57 69 6e 64 6f 77 29 0d |Ptr plot|Window).|
|00001f50| 2f 2a 0d 4d 65 61 73 75 | 72 65 73 20 74 68 65 20 |/*.Measu|res the |
|00001f60| 63 6f 6e 74 72 61 73 74 | 20 6f 66 20 61 20 64 72 |contrast| of a dr|
|00001f70| 69 66 74 69 6e 67 20 67 | 72 61 74 69 6e 67 20 6f |ifting g|rating o|
|00001f80| 66 20 75 6e 6b 6e 6f 77 | 6e 20 70 68 61 73 65 2e |f unknow|n phase.|
|00001f90| 0d 54 68 65 20 74 65 6d | 70 6f 72 61 6c 20 70 65 |.The tem|poral pe|
|00001fa0| 72 69 6f 64 20 69 73 20 | 74 50 65 72 69 6f 64 20 |riod is |tPeriod |
|00001fb0| 66 72 61 6d 65 73 2e 20 | 54 68 65 20 63 5b 5d 20 |frames. |The c[] |
|00001fc0| 61 72 72 61 79 20 69 73 | 0d 66 69 6c 6c 65 64 20 |array is|.filled |
|00001fd0| 77 69 74 68 20 74 68 65 | 20 61 6d 70 6c 69 74 75 |with the| amplitu|
|00001fe0| 64 65 20 73 70 65 63 74 | 72 75 6d 2c 20 77 68 65 |de spect|rum, whe|
|00001ff0| 72 65 20 63 5b 69 5d 20 | 69 73 20 74 68 65 20 63 |re c[i] |is the c|
|00002000| 6f 6e 74 72 61 73 74 20 | 6f 66 20 74 68 65 20 69 |ontrast |of the i|
|00002010| 2d 74 68 20 68 61 72 6d | 6f 6e 69 63 2c 0d 65 78 |-th harm|onic,.ex|
|00002020| 63 65 70 74 20 74 68 61 | 74 20 63 5b 30 5d 2c 20 |cept tha|t c[0], |
|00002030| 77 68 69 63 68 20 77 6f | 75 6c 64 20 61 6c 77 61 |which wo|uld alwa|
|00002040| 79 73 20 62 65 20 31 2c | 20 69 6e 73 74 65 61 64 |ys be 1,| instead|
|00002050| 20 69 73 20 73 65 74 20 | 74 6f 20 74 68 65 20 64 | is set |to the d|
|00002060| 63 20 6c 65 76 65 6c 2e | 0d 2a 2f 0d 7b 0d 09 64 |c level.|.*/.{..d|
|00002070| 6f 75 62 6c 65 20 76 5b | 32 35 36 5d 3b 0d 09 64 |ouble v[|256];..d|
|00002080| 6f 75 62 6c 65 20 70 5b | 31 30 5d 3b 0d 09 72 65 |ouble p[|10];..re|
|00002090| 67 69 73 74 65 72 20 69 | 6e 74 20 69 2c 6a 3b 0d |gister i|nt i,j;.|
|000020a0| 09 43 6f 6c 6f 72 53 70 | 65 63 20 64 6f 75 62 6c |.ColorSp|ec doubl|
|000020b0| 65 54 61 62 6c 65 5b 35 | 31 32 5d 3b 09 2f 2f 20 |eTable[5|12];.// |
|000020c0| 77 61 73 20 73 74 61 74 | 69 63 2c 20 64 67 70 20 |was stat|ic, dgp |
|000020d0| 36 2f 31 35 2f 39 34 0d | 09 73 74 61 74 69 63 20 |6/15/94.|.static |
|000020e0| 64 6f 75 62 6c 65 20 73 | 69 6e 54 61 62 6c 65 5b |double s|inTable[|
|000020f0| 32 35 36 5d 2c 63 6f 73 | 54 61 62 6c 65 5b 32 35 |256],cos|Table[25|
|00002100| 36 5d 3b 0d 09 73 74 61 | 74 69 63 20 69 6e 74 20 |6];..sta|tic int |
|00002110| 74 61 62 6c 65 50 65 72 | 69 6f 64 3d 30 3b 0d 09 |tablePer|iod=0;..|
|00002120| 72 65 67 69 73 74 65 72 | 20 64 6f 75 62 6c 65 20 |register| double |
|00002130| 61 2c 62 3b 0d 09 64 6f | 75 62 6c 65 20 66 72 65 |a,b;..do|uble fre|
|00002140| 71 75 65 6e 63 79 3d 32 | 30 30 30 2e 2c 67 61 69 |quency=2|000.,gai|
|00002150| 6e 3d 31 30 30 2e 3b 0d | 09 64 6f 75 62 6c 65 20 |n=100.;.|.double |
|00002160| 66 72 61 6d 65 73 3d 30 | 2e 36 3b 09 2f 2a 20 48 |frames=0|.6;./* H|
|00002170| 6f 77 20 6c 6f 6e 67 20 | 74 68 65 20 41 2f 44 20 |ow long |the A/D |
|00002180| 73 68 6f 75 6c 64 20 73 | 70 65 6e 64 20 73 61 6d |should s|pend sam|
|00002190| 70 6c 69 6e 67 20 74 68 | 65 20 70 68 6f 74 6f 6d |pling th|e photom|
|000021a0| 65 74 65 72 20 2a 2f 0d | 09 6c 6f 6e 67 20 6e 3b |eter */.|.long n;|
|000021b0| 0d 09 73 74 61 74 69 63 | 20 64 6f 75 62 6c 65 20 |..static| double |
|000021c0| 76 42 6c 61 63 6b 3d 30 | 2e 30 3b 0d 09 73 74 61 |vBlack=0|.0;..sta|
|000021d0| 74 69 63 20 69 6e 74 20 | 62 6c 61 63 6b 53 65 74 |tic int |blackSet|
|000021e0| 3d 30 3b 0d 09 63 68 61 | 72 20 73 74 72 69 6e 67 |=0;..cha|r string|
|000021f0| 5b 38 30 5d 3b 0d 09 57 | 69 6e 64 6f 77 50 74 72 |[80];..W|indowPtr|
|00002200| 20 6f 6c 64 50 6f 72 74 | 3b 0d 09 69 6e 74 20 76 | oldPort|;..int v|
|00002210| 30 2c 69 70 3b 0d 0d 09 | 61 73 73 65 72 74 28 53 |0,ip;...|assert(S|
|00002220| 74 61 63 6b 53 70 61 63 | 65 28 29 3e 34 30 30 30 |tackSpac|e()>4000|
|00002230| 29 3b 0d 09 69 66 28 74 | 50 65 72 69 6f 64 3e 32 |);..if(t|Period>2|
|00002240| 35 36 29 7b 0d 09 09 70 | 72 69 6e 74 66 28 22 57 |56){...p|rintf("W|
|00002250| 61 72 6e 69 6e 67 2e 20 | 52 65 64 75 63 69 6e 67 |arning. |Reducing|
|00002260| 20 74 50 65 72 69 6f 64 | 20 74 6f 20 32 35 36 2e | tPeriod| to 256.|
|00002270| 5c 6e 22 29 3b 0d 09 09 | 74 50 65 72 69 6f 64 3d |\n");...|tPeriod=|
|00002280| 32 35 36 3b 0d 09 7d 0d | 09 69 66 28 74 61 62 6c |256;..}.|.if(tabl|
|00002290| 65 50 65 72 69 6f 64 20 | 21 3d 20 74 50 65 72 69 |ePeriod |!= tPeri|
|000022a0| 6f 64 29 7b 0d 09 09 66 | 6f 72 28 69 3d 30 3b 69 |od){...f|or(i=0;i|
|000022b0| 3c 74 50 65 72 69 6f 64 | 3b 69 2b 2b 29 7b 0d 09 |<tPeriod|;i++){..|
|000022c0| 09 09 73 69 6e 54 61 62 | 6c 65 5b 69 5d 3d 73 69 |..sinTab|le[i]=si|
|000022d0| 6e 28 69 2a 54 57 4f 5f | 50 49 2f 74 50 65 72 69 |n(i*TWO_|PI/tPeri|
|000022e0| 6f 64 29 3b 0d 09 09 09 | 63 6f 73 54 61 62 6c 65 |od);....|cosTable|
|000022f0| 5b 69 5d 3d 63 6f 73 28 | 69 2a 54 57 4f 5f 50 49 |[i]=cos(|i*TWO_PI|
|00002300| 2f 74 50 65 72 69 6f 64 | 29 3b 0d 09 09 7d 0d 09 |/tPeriod|);...}..|
|00002310| 09 74 61 62 6c 65 50 65 | 72 69 6f 64 3d 74 50 65 |.tablePe|riod=tPe|
|00002320| 72 69 6f 64 3b 0d 09 7d | 0d 09 0d 09 6e 3d 28 6c |riod;..}|....n=(l|
|00002330| 6f 6e 67 29 66 6c 6f 6f | 72 28 30 2e 35 2b 66 72 |ong)floo|r(0.5+fr|
|00002340| 65 71 75 65 6e 63 79 2a | 30 2e 30 31 35 2a 66 72 |equency*|0.015*fr|
|00002350| 61 6d 65 73 29 3b 0d 0d | 09 52 65 6d 65 61 73 75 |ames);..|.Remeasu|
|00002360| 72 65 43 6f 6e 74 72 61 | 73 74 3a 0d 09 69 66 28 |reContra|st:..if(|
|00002370| 21 62 6c 61 63 6b 53 65 | 74 29 7b 0d 09 09 64 6f |!blackSe|t){...do|
|00002380| 75 62 6c 65 54 61 62 6c | 65 5b 30 5d 2e 72 67 62 |ubleTabl|e[0].rgb|
|00002390| 2e 72 65 64 3d 64 6f 75 | 62 6c 65 54 61 62 6c 65 |.red=dou|bleTable|
|000023a0| 5b 30 5d 2e 72 67 62 2e | 67 72 65 65 6e 3d 64 6f |[0].rgb.|green=do|
|000023b0| 75 62 6c 65 54 61 62 6c | 65 5b 30 5d 2e 72 67 62 |ubleTabl|e[0].rgb|
|000023c0| 2e 62 6c 75 65 3d 30 3b | 0d 09 09 66 6f 72 28 69 |.blue=0;|...for(i|
|000023d0| 3d 30 3b 69 3c 32 35 36 | 3b 69 2b 2b 29 64 6f 75 |=0;i<256|;i++)dou|
|000023e0| 62 6c 65 54 61 62 6c 65 | 5b 69 5d 3d 64 6f 75 62 |bleTable|[i]=doub|
|000023f0| 6c 65 54 61 62 6c 65 5b | 69 2b 32 35 36 5d 3d 64 |leTable[|i+256]=d|
|00002400| 6f 75 62 6c 65 54 61 62 | 6c 65 5b 30 5d 3b 0d 09 |oubleTab|le[0];..|
|00002410| 09 4c 6f 61 64 4c 75 6d | 69 6e 61 6e 63 65 73 28 |.LoadLum|inances(|
|00002420| 64 65 76 69 63 65 0d 09 | 09 09 2c 28 4c 75 6d 69 |device..|..,(Lumi|
|00002430| 6e 61 6e 63 65 52 65 63 | 6f 72 64 20 2a 29 28 64 |nanceRec|ord *)(d|
|00002440| 6f 75 62 6c 65 54 61 62 | 6c 65 2b 28 69 25 74 50 |oubleTab|le+(i%tP|
|00002450| 65 72 69 6f 64 29 2a 28 | 32 35 36 2f 74 50 65 72 |eriod)*(|256/tPer|
|00002460| 69 6f 64 29 29 2c 30 2c | 32 35 35 29 3b 0d 09 09 |iod)),0,|255);...|
|00002470| 70 72 69 6e 74 66 28 22 | 50 6c 65 61 73 65 20 62 |printf("|Please b|
|00002480| 6c 6f 63 6b 20 61 6c 6c | 20 6c 69 67 68 74 20 74 |lock all| light t|
|00002490| 6f 20 73 65 74 20 62 6c | 61 63 6b 2e 20 48 69 74 |o set bl|ack. Hit|
|000024a0| 20 63 72 20 77 68 65 6e | 20 72 65 61 64 79 3a 22 | cr when| ready:"|
|000024b0| 29 3b 0d 09 09 67 65 74 | 73 28 73 74 72 69 6e 67 |);...get|s(string|
|000024c0| 29 3b 0d 09 09 76 42 6c | 61 63 6b 3d 30 2e 30 3b |);...vBl|ack=0.0;|
|000024d0| 0d 09 7d 0d 09 65 6c 73 | 65 20 66 6f 72 28 69 3d |..}..els|e for(i=|
|000024e0| 30 3b 69 3c 32 35 36 3b | 69 2b 2b 29 64 6f 75 62 |0;i<256;|i++)doub|
|000024f0| 6c 65 54 61 62 6c 65 5b | 69 5d 3d 64 6f 75 62 6c |leTable[|i]=doubl|
|00002500| 65 54 61 62 6c 65 5b 69 | 2b 32 35 36 5d 3d 4c 50 |eTable[i|+256]=LP|
|00002510| 2d 3e 74 61 62 6c 65 5b | 69 5d 3b 0d 0d 09 2f 2a |->table[|i];.../*|
|00002520| 20 77 61 72 6d 20 75 70 | 20 66 6f 72 20 6f 6e 65 | warm up| for one|
|00002530| 20 70 65 72 69 6f 64 20 | 62 65 66 6f 72 65 20 63 | period |before c|
|00002540| 6f 6c 6c 65 63 74 69 6e | 67 20 64 61 74 61 20 2a |ollectin|g data *|
|00002550| 2f 0d 09 53 65 74 50 72 | 69 6f 72 69 74 79 28 37 |/..SetPr|iority(7|
|00002560| 29 3b 0d 09 66 6f 72 28 | 69 3d 30 3b 69 3c 74 50 |);..for(|i=0;i<tP|
|00002570| 65 72 69 6f 64 3b 69 2b | 2b 29 7b 0d 09 09 4c 6f |eriod;i+|+){...Lo|
|00002580| 61 64 4c 75 6d 69 6e 61 | 6e 63 65 73 28 64 65 76 |adLumina|nces(dev|
|00002590| 69 63 65 0d 09 09 09 2c | 28 4c 75 6d 69 6e 61 6e |ice....,|(Luminan|
|000025a0| 63 65 52 65 63 6f 72 64 | 20 2a 29 28 64 6f 75 62 |ceRecord| *)(doub|
|000025b0| 6c 65 54 61 62 6c 65 2b | 28 69 25 74 50 65 72 69 |leTable+|(i%tPeri|
|000025c0| 6f 64 29 2a 28 32 35 36 | 2f 74 50 65 72 69 6f 64 |od)*(256|/tPeriod|
|000025d0| 29 29 2c 30 2c 32 35 35 | 29 3b 0d 09 09 47 65 74 |)),0,255|);...Get|
|000025e0| 56 6f 6c 74 61 67 65 28 | 31 2c 26 67 61 69 6e 2c |Voltage(|1,&gain,|
|000025f0| 26 66 72 65 71 75 65 6e | 63 79 2c 6e 2c 4e 55 4c |&frequen|cy,n,NUL|
|00002600| 4c 29 3b 0d 09 09 76 5b | 69 5d 3d 30 2e 30 3b 0d |L);...v[|i]=0.0;.|
|00002610| 09 7d 0d 09 23 69 66 20 | 28 54 48 49 4e 4b 5f 43 |.}..#if |(THINK_C|
|00002620| 20 7c 7c 20 54 48 49 4e | 4b 5f 43 50 4c 55 53 29 | || THIN|K_CPLUS)|
|00002630| 0d 09 09 5f 70 72 6f 66 | 69 6c 65 3d 31 3b 0d 09 |..._prof|ile=1;..|
|00002640| 23 65 6e 64 69 66 0d 09 | 66 6f 72 28 69 3d 30 3b |#endif..|for(i=0;|
|00002650| 69 3c 74 50 65 72 69 6f | 64 2a 34 3b 69 2b 2b 29 |i<tPerio|d*4;i++)|
|00002660| 7b 0d 09 09 4c 6f 61 64 | 4c 75 6d 69 6e 61 6e 63 |{...Load|Luminanc|
|00002670| 65 73 28 64 65 76 69 63 | 65 0d 09 09 09 2c 28 4c |es(devic|e....,(L|
|00002680| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 20 2a |uminance|Record *|
|00002690| 29 28 64 6f 75 62 6c 65 | 54 61 62 6c 65 2b 28 69 |)(double|Table+(i|
|000026a0| 25 74 50 65 72 69 6f 64 | 29 2a 28 32 35 36 2f 74 |%tPeriod|)*(256/t|
|000026b0| 50 65 72 69 6f 64 29 29 | 2c 30 2c 32 35 35 29 3b |Period))|,0,255);|
|000026c0| 0d 09 09 76 5b 69 25 74 | 50 65 72 69 6f 64 5d 2b |...v[i%t|Period]+|
|000026d0| 3d 47 65 74 56 6f 6c 74 | 61 67 65 28 31 2c 26 67 |=GetVolt|age(1,&g|
|000026e0| 61 69 6e 2c 26 66 72 65 | 71 75 65 6e 63 79 2c 6e |ain,&fre|quency,n|
|000026f0| 2c 4e 55 4c 4c 29 3b 0d | 09 7d 0d 09 23 69 66 20 |,NULL);.|.}..#if |
|00002700| 28 54 48 49 4e 4b 5f 43 | 20 7c 7c 20 54 48 49 4e |(THINK_C| || THIN|
|00002710| 4b 5f 43 50 4c 55 53 29 | 0d 09 09 5f 70 72 6f 66 |K_CPLUS)|..._prof|
|00002720| 69 6c 65 3d 30 3b 0d 09 | 23 65 6e 64 69 66 0d 09 |ile=0;..|#endif..|
|00002730| 53 65 74 50 72 69 6f 72 | 69 74 79 28 30 29 3b 0d |SetPrior|ity(0);.|
|00002740| 09 61 3d 30 2e 30 3b 0d | 09 66 6f 72 28 69 3d 30 |.a=0.0;.|.for(i=0|
|00002750| 3b 69 3c 74 50 65 72 69 | 6f 64 3b 69 2b 2b 29 20 |;i<tPeri|od;i++) |
|00002760| 61 2b 3d 76 5b 69 5d 3b | 0d 09 63 5b 30 5d 3d 61 |a+=v[i];|..c[0]=a|
|00002770| 2f 74 50 65 72 69 6f 64 | 2d 76 42 6c 61 63 6b 3b |/tPeriod|-vBlack;|
|00002780| 0d 09 69 66 28 21 62 6c | 61 63 6b 53 65 74 29 7b |..if(!bl|ackSet){|
|00002790| 0d 09 09 76 42 6c 61 63 | 6b 3d 63 5b 30 5d 3b 0d |...vBlac|k=c[0];.|
|000027a0| 09 09 62 6c 61 63 6b 53 | 65 74 3d 31 3b 0d 09 09 |..blackS|et=1;...|
|000027b0| 70 72 69 6e 74 66 28 22 | 42 6c 61 63 6b 20 25 67 |printf("|Black %g|
|000027c0| 20 6d 56 5c 6e 22 2c 76 | 42 6c 61 63 6b 2a 31 30 | mV\n",v|Black*10|
|000027d0| 30 30 2e 30 29 3b 0d 09 | 09 70 72 69 6e 74 66 28 |00.0);..|.printf(|
|000027e0| 22 4e 6f 77 20 70 6c 65 | 61 73 65 20 72 65 6d 6f |"Now ple|ase remo|
|000027f0| 76 65 20 6c 69 67 68 74 | 20 62 6c 6f 63 6b 2e 20 |ve light| block. |
|00002800| 48 69 74 20 63 72 20 77 | 68 65 6e 20 72 65 61 64 |Hit cr w|hen read|
|00002810| 79 3a 22 29 3b 0d 09 09 | 67 65 74 73 28 73 74 72 |y:");...|gets(str|
|00002820| 69 6e 67 29 3b 0d 09 09 | 67 6f 74 6f 20 52 65 6d |ing);...|goto Rem|
|00002830| 65 61 73 75 72 65 43 6f | 6e 74 72 61 73 74 3b 0d |easureCo|ntrast;.|
|00002840| 09 7d 0d 09 66 6f 72 28 | 6a 3d 31 3b 6a 3c 31 30 |.}..for(|j=1;j<10|
|00002850| 3b 6a 2b 2b 29 7b 0d 09 | 09 61 3d 62 3d 30 2e 30 |;j++){..|.a=b=0.0|
|00002860| 3b 0d 09 09 66 6f 72 28 | 69 3d 30 3b 69 3c 74 50 |;...for(|i=0;i<tP|
|00002870| 65 72 69 6f 64 3b 69 2b | 2b 29 7b 0d 09 09 09 61 |eriod;i+|+){....a|
|00002880| 2b 3d 73 69 6e 54 61 62 | 6c 65 5b 69 2a 6a 25 74 |+=sinTab|le[i*j%t|
|00002890| 50 65 72 69 6f 64 5d 2a | 76 5b 69 5d 3b 0d 09 09 |Period]*|v[i];...|
|000028a0| 09 62 2b 3d 63 6f 73 54 | 61 62 6c 65 5b 69 2a 6a |.b+=cosT|able[i*j|
|000028b0| 25 74 50 65 72 69 6f 64 | 5d 2a 76 5b 69 5d 3b 0d |%tPeriod|]*v[i];.|
|000028c0| 09 09 7d 0d 09 09 63 5b | 6a 5d 3d 32 2e 30 2a 73 |..}...c[|j]=2.0*s|
|000028d0| 71 72 74 28 61 2a 61 2b | 62 2a 62 29 2f 74 50 65 |qrt(a*a+|b*b)/tPe|
|000028e0| 72 69 6f 64 2f 63 5b 30 | 5d 3b 0d 09 09 70 5b 6a |riod/c[0|];...p[j|
|000028f0| 5d 3d 61 74 61 6e 32 28 | 61 2c 62 29 3b 0d 09 7d |]=atan2(|a,b);..}|
|00002900| 0d 09 2f 2a 20 53 68 6f | 77 20 6f 6e 65 20 70 65 |../* Sho|w one pe|
|00002910| 72 69 6f 64 20 6f 66 20 | 72 61 77 20 64 61 74 61 |riod of |raw data|
|00002920| 2c 20 66 75 6e 64 61 6d | 65 6e 74 61 6c 2c 20 72 |, fundam|ental, r|
|00002930| 61 77 20 6d 69 6e 75 73 | 20 66 75 6e 64 61 6d 65 |aw minus| fundame|
|00002940| 6e 74 61 6c 2c 20 32 6e | 64 20 68 61 72 6d 6f 6e |ntal, 2n|d harmon|
|00002950| 69 63 20 2a 2f 0d 09 47 | 65 74 50 6f 72 74 28 26 |ic */..G|etPort(&|
|00002960| 6f 6c 64 50 6f 72 74 29 | 3b 0d 09 53 65 74 50 6f |oldPort)|;..SetPo|
|00002970| 72 74 28 70 6c 6f 74 57 | 69 6e 64 6f 77 29 3b 0d |rt(plotW|indow);.|
|00002980| 09 42 72 69 6e 67 54 6f | 46 72 6f 6e 74 28 70 6c |.BringTo|Front(pl|
|00002990| 6f 74 57 69 6e 64 6f 77 | 29 3b 0d 09 45 72 61 73 |otWindow|);..Eras|
|000029a0| 65 52 65 63 74 28 26 70 | 6c 6f 74 57 69 6e 64 6f |eRect(&p|lotWindo|
|000029b0| 77 2d 3e 70 6f 72 74 52 | 65 63 74 29 3b 0d 09 76 |w->portR|ect);..v|
|000029c0| 30 3d 70 6c 6f 74 57 69 | 6e 64 6f 77 2d 3e 70 6f |0=plotWi|ndow->po|
|000029d0| 72 74 52 65 63 74 2e 62 | 6f 74 74 6f 6d 2f 34 3b |rtRect.b|ottom/4;|
|000029e0| 0d 09 53 65 74 4f 72 69 | 67 69 6e 28 30 2c 2d 32 |..SetOri|gin(0,-2|
|000029f0| 2a 76 30 29 3b 0d 09 4d | 6f 76 65 54 6f 28 30 2c |*v0);..M|oveTo(0,|
|00002a00| 2d 76 30 2a 28 76 5b 30 | 5d 2d 76 42 6c 61 63 6b |-v0*(v[0|]-vBlack|
|00002a10| 29 2f 63 5b 30 5d 29 3b | 0d 09 66 6f 72 28 69 3d |)/c[0]);|..for(i=|
|00002a20| 31 3b 69 3c 74 50 65 72 | 69 6f 64 3b 69 2b 2b 29 |1;i<tPer|iod;i++)|
|00002a30| 4c 69 6e 65 54 6f 28 69 | 2c 2d 76 30 2a 28 76 5b |LineTo(i|,-v0*(v[|
|00002a40| 69 5d 2d 76 42 6c 61 63 | 6b 29 2f 63 5b 30 5d 29 |i]-vBlac|k)/c[0])|
|00002a50| 3b 0d 09 53 65 74 4f 72 | 69 67 69 6e 28 30 2c 2d |;..SetOr|igin(0,-|
|00002a60| 34 2a 76 30 29 3b 0d 09 | 6a 3d 31 3b 0d 09 69 70 |4*v0);..|j=1;..ip|
|00002a70| 3d 74 50 65 72 69 6f 64 | 2a 28 31 2e 30 2d 70 5b |=tPeriod|*(1.0-p[|
|00002a80| 6a 5d 2f 54 57 4f 5f 50 | 49 29 3b 0d 09 61 3d 2d |j]/TWO_P|I);..a=-|
|00002a90| 76 30 2a 28 30 2e 30 2b | 63 5b 6a 5d 2a 63 6f 73 |v0*(0.0+|c[j]*cos|
|00002aa0| 54 61 62 6c 65 5b 28 69 | 2a 6a 2b 69 70 29 25 74 |Table[(i|*j+ip)%t|
|00002ab0| 50 65 72 69 6f 64 5d 29 | 3b 0d 09 4d 6f 76 65 54 |Period])|;..MoveT|
|00002ac0| 6f 28 30 2c 2d 76 30 2a | 28 76 5b 30 5d 2d 76 42 |o(0,-v0*|(v[0]-vB|
|00002ad0| 6c 61 63 6b 29 2f 63 5b | 30 5d 2d 61 29 3b 0d 09 |lack)/c[|0]-a);..|
|00002ae0| 66 6f 72 28 69 3d 31 3b | 69 3c 74 50 65 72 69 6f |for(i=1;|i<tPerio|
|00002af0| 64 3b 69 2b 2b 29 7b 0d | 09 09 61 3d 2d 76 30 2a |d;i++){.|..a=-v0*|
|00002b00| 28 30 2e 30 2b 63 5b 6a | 5d 2a 63 6f 73 54 61 62 |(0.0+c[j|]*cosTab|
|00002b10| 6c 65 5b 28 69 2a 6a 2b | 69 70 29 25 74 50 65 72 |le[(i*j+|ip)%tPer|
|00002b20| 69 6f 64 5d 29 3b 0d 09 | 09 4c 69 6e 65 54 6f 28 |iod]);..|.LineTo(|
|00002b30| 69 2c 2d 76 30 2a 28 76 | 5b 69 5d 2d 76 42 6c 61 |i,-v0*(v|[i]-vBla|
|00002b40| 63 6b 29 2f 63 5b 30 5d | 2d 61 29 3b 0d 09 7d 0d |ck)/c[0]|-a);..}.|
|00002b50| 09 46 6f 72 65 43 6f 6c | 6f 72 28 62 6c 75 65 43 |.ForeCol|or(blueC|
|00002b60| 6f 6c 6f 72 29 3b 0d 09 | 66 6f 72 28 6a 3d 31 3b |olor);..|for(j=1;|
|00002b70| 6a 3c 33 3b 6a 2b 2b 29 | 7b 0d 09 09 53 65 74 4f |j<3;j++)|{...SetO|
|00002b80| 72 69 67 69 6e 28 2d 74 | 50 65 72 69 6f 64 2c 2d |rigin(-t|Period,-|
|00002b90| 32 2a 76 30 2a 6a 29 3b | 0d 09 09 69 70 3d 74 50 |2*v0*j);|...ip=tP|
|00002ba0| 65 72 69 6f 64 2a 28 31 | 2e 30 2d 70 5b 6a 5d 2f |eriod*(1|.0-p[j]/|
|00002bb0| 54 57 4f 5f 50 49 29 3b | 0d 09 09 69 3d 30 3b 0d |TWO_PI);|...i=0;.|
|00002bc0| 09 09 61 3d 2d 76 30 2a | 28 31 2e 30 2b 63 5b 6a |..a=-v0*|(1.0+c[j|
|00002bd0| 5d 2a 63 6f 73 54 61 62 | 6c 65 5b 28 69 2a 6a 2b |]*cosTab|le[(i*j+|
|00002be0| 69 70 29 25 74 50 65 72 | 69 6f 64 5d 29 3b 0d 09 |ip)%tPer|iod]);..|
|00002bf0| 09 4d 6f 76 65 54 6f 28 | 30 2c 61 29 3b 0d 09 09 |.MoveTo(|0,a);...|
|00002c00| 66 6f 72 28 69 3d 31 3b | 69 3c 74 50 65 72 69 6f |for(i=1;|i<tPerio|
|00002c10| 64 3b 69 2b 2b 29 7b 0d | 09 09 09 61 3d 2d 76 30 |d;i++){.|...a=-v0|
|00002c20| 2a 28 31 2e 30 2b 63 5b | 6a 5d 2a 63 6f 73 54 61 |*(1.0+c[|j]*cosTa|
|00002c30| 62 6c 65 5b 28 69 2a 6a | 2b 69 70 29 25 74 50 65 |ble[(i*j|+ip)%tPe|
|00002c40| 72 69 6f 64 5d 29 3b 0d | 09 09 09 4c 69 6e 65 54 |riod]);.|...LineT|
|00002c50| 6f 28 69 2c 61 29 3b 0d | 09 09 7d 0d 09 7d 0d 09 |o(i,a);.|..}..}..|
|00002c60| 46 6f 72 65 43 6f 6c 6f | 72 28 62 6c 61 63 6b 43 |ForeColo|r(blackC|
|00002c70| 6f 6c 6f 72 29 3b 0d 09 | 53 65 74 4f 72 69 67 69 |olor);..|SetOrigi|
|00002c80| 6e 28 30 2c 30 29 3b 0d | 09 53 65 74 50 6f 72 74 |n(0,0);.|.SetPort|
|00002c90| 28 6f 6c 64 50 6f 72 74 | 29 3b 0d 09 72 65 74 75 |(oldPort|);..retu|
|00002ca0| 72 6e 20 63 5b 31 5d 3b | 0d 7d 0d 0d 0d 64 6f 75 |rn c[1];|.}...dou|
|00002cb0| 62 6c 65 20 73 61 77 28 | 64 6f 75 62 6c 65 20 78 |ble saw(|double x|
|00002cc0| 29 0d 2f 2a 20 72 65 74 | 75 72 6e 73 20 73 61 77 |)./* ret|urns saw|
|00002cd0| 74 6f 6f 74 68 20 66 75 | 6e 63 74 69 6f 6e 20 77 |tooth fu|nction w|
|00002ce0| 69 74 68 20 73 61 6d 65 | 20 70 68 61 73 65 2c 20 |ith same| phase, |
|00002cf0| 61 6d 70 6c 69 74 75 64 | 65 2c 20 61 6e 64 20 73 |amplitud|e, and s|
|00002d00| 79 6d 6d 65 74 72 79 20 | 61 73 20 73 69 6e 28 29 |ymmetry |as sin()|
|00002d10| 20 2a 2f 0d 7b 0d 09 78 | 2f 3d 54 57 4f 5f 50 49 | */.{..x|/=TWO_PI|
|00002d20| 3b 0d 09 78 2d 3d 30 2e | 35 3b 0d 09 78 2d 3d 66 |;..x-=0.|5;..x-=f|
|00002d30| 6c 6f 6f 72 28 78 29 3b | 0d 09 72 65 74 75 72 6e |loor(x);|..return|
|00002d40| 20 32 2e 30 2a 78 2d 31 | 2e 30 3b 0d 7d 0d 00 00 | 2.0*x-1|.0;.}...|
|00002d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d80| 00 00 01 00 00 00 01 98 | 00 00 00 98 00 00 00 3e |........|.......>|
|00002d90| 00 00 14 2d 08 52 41 54 | 4c 53 51 2e 43 00 02 00 |...-.RAT|LSQ.C...|
|00002da0| 00 00 54 45 58 54 4b 41 | 48 4c 01 00 03 48 00 c0 |..TEXTKA|HL...H..|
|00002db0| 0c 4d 65 61 73 75 72 65 | 4d 54 46 2e 63 5c 02 00 |.Measure|MTF.c\..|
|00002dc0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00002dd0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00002de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002df0| 00 00 ab bf ee 4b 00 00 | 00 00 00 00 01 d6 00 00 |.....K..|........|
|00002e00| 00 00 00 00 0e 00 00 00 | 14 2d 08 52 41 54 56 41 |........|.-.RATVA|
|00002e10| 4c 2e 43 00 02 00 00 00 | 54 45 58 54 4b 41 48 4c |L.C.....|TEXTKAHL|
|00002e20| 01 00 03 48 01 20 00 00 | 00 00 15 2d 00 00 00 00 |...H. ..|...-....|
|00002e30| 00 e1 00 00 26 00 00 00 | 00 00 00 00 00 00 00 00 |....&...|........|
|00002e40| a7 3e e3 01 a7 3e e3 01 | 00 00 00 00 00 00 00 00 |.>...>..|........|
|00002e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 4f 76 |........|......Ov|
|00002e60| 00 01 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e70| 00 00 00 00 00 00 00 00 | 00 00 0a 00 00 00 14 2d |........|.......-|
|00002e80| 00 00 00 48 00 04 00 00 | 1e 49 00 00 1e 58 0f 4d |...H....|.I...X.M|
|00002e90| 65 61 73 75 72 65 43 6f | 6e 74 72 61 73 74 00 00 |easureCo|ntrast..|
|00002ea0| 05 1c 00 00 05 26 0b 4d | 65 61 73 75 72 65 4d 54 |.....&.M|easureMT|
|00002eb0| 46 00 00 00 04 b0 00 00 | 04 b4 05 6d 61 69 6e 00 |F.......|...main.|
|00002ec0| 00 00 2b f0 00 00 2b f3 | 03 73 61 77 00 00 00 48 |..+...+.|.saw...H|
|00002ed0| 00 09 4d 6f 6e 61 63 6f | 00 00 00 00 00 00 00 00 |..Monaco|........|
|00002ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ef0| 00 00 00 06 00 04 00 2a | 00 03 02 fd 03 fd 00 3c |.......*|.......<|
|00002f00| 00 04 01 8c 02 7e aa df | 5e 20 00 00 1d 22 00 00 |.....~..|^ ..."..|
|00002f10| 1d 22 00 00 00 00 00 00 | 00 00 01 00 00 00 01 98 |."......|........|
|00002f20| 00 00 00 98 00 00 00 3e | 01 68 02 00 27 aa 00 00 |.......>|.h..'...|
|00002f30| 00 1c 00 3e 00 00 4d 50 | 53 52 00 01 00 0a 03 ef |...>..MP|SR......|
|00002f40| ff ff 00 00 00 00 00 00 | 00 00 03 ed ff ff 00 00 |........|........|
|00002f50| 00 4c 01 68 01 64 00 00 | 00 00 00 00 00 00 00 00 |.L.h.d..|........|
|00002f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+